Here's the first thing I'd try; change the job command to:

rbenv exec bundle exec analysis help

That's very likely overkill, but at least if that works you've got a
base to experiment with. Bundler and rbenv depend on the right things
being present in the PATH, and there are lots of weird subtleties about
how paths are treated. For example, there are differences between
interactive shells (like when you're ssh'd in to the machine) and non-
interactive shells (like what jenkins is probably running under). And I
swear there must be variations in the PATH provide to a regular command
vs a sudo command vs a `sudo su` shell, but I've never even figured out
what they are.

On Fri, Aug 25, 2017, at 12:43 PM, Hillary Hueter wrote:
> I posted this to stack overflow, but it hasn't been answered. 


> 


> 


> I have very little experience with both jenkins and linux.


> 


> I'm setting up a jenkins job to run a custom gem that i've built.


> 


> I've installed ruby on the box using rbenv and the gem was installed
> (using gem install path/to/package) into the correct path.> So if i run the 
> following under the jenkins user (sudo su user)


> analysis help


> it brings up the command line help correctly.


> 


> however when i run the same command in the jenkins job i get the
> following error:


> Building in workspace
> /var/lib/jenkins/jobs/migration_rec_process/workspace [workspace] $
> /bin/sh -xe /tmp/hudson8725909616346406706.sh
> + analysis help /tmp/hudson8725909616346406706.sh: 2:
>   /tmp/hudson8725909616346406706.sh: analysis: not found Build step
>   'Execute shell' marked build as failure> My execute shell for the job is:


> analysis help
> I have other jobs that use other installed ruby libraries just fine. I
> really cannot figure out what's going on here.> 


> 


> i also get the not found error if i log in as the jenkins user and run
> the following:> rbenv analysis help 


> sudo analysis help


> 


> 


> Anyone have any ideas on what's going on? 


> 


> --
>  -- 
>  SD Ruby mailing list
>  [email protected]
> http://groups.google.com/group/sdruby
>  --- 
>  You received this message because you are subscribed to the Google
>  Groups "SD Ruby" group.>  To unsubscribe from this group and stop receiving 
> emails from it,
>  send an email to [email protected].>  For more options, 
> visit https://groups.google.com/d/optout.

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to