I am currently trying to run a jenkins build for some of my cucumber tasks. All of my gems have been installed by using the Bundler. The gems are stored in the vendor folder.
However, when I try and run bundle install --deployment
in the execute shell build step, I get the following error:
Started by user anonymous
Building in workspace /Users/Shared/Jenkins/Home/jobs/cukes/workspace
[workspace] $ /bin/sh -xe/var/folders/zz/zyxvpxvq6csfxvn_n0000004000001/T/hudson4461284045505361460.sh
+ bundle install --deployment
/var/folders/zz/zyxvpxvq6csfxvn_n0000004000001/T/hudson4461284045505361460.sh: line 2: bundle: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
This is driving me crazy! It runs on my local machine with no problems. Why can't Jenkins see my gems?
Any help would be great!
Cheers, Jon
For me I had originally installed it via the war file as that's the way recommended on the Getting Started Guide. However, the user handbook makes it much more clear that there are probably better ways to install Jenkins.
I ended up uninstalling the WAR file of Jenkins on macOS by:
I then reinstalled via home-brew, and
bundle
started working.If bundle is installed in
/usr/local/bin/bundle
(determine this withwhich bundle
) you could just add a symbolic link to bundle in/usr/bin
like so:ln -s /usr/local/bin/bundle /usr/bin/bundle
Depending on the way you installed Jenkins, it might be running as a separate user, typically as user
jenkins
. If you have installedbundle
into a nonstandard directory which isn't in the default PATH, like/usr/local/bin
, you need to:/usr/local/bin
to the PATH of the jenkins user (check ~jenkins/.bashrc) orbundle
using a full path name.First things to verify:
bundle
is installed on the machine where Jenkins runs.(To verify path/environment: insert shell build step that runs
env
)You could see where is
bundle
is installed by runningwhich bundle
and run thebundle
command from there