Can't run Jenkins Build - bundle: “command not found”











up vote
11
down vote

favorite
4












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










share|improve this question




























    up vote
    11
    down vote

    favorite
    4












    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










    share|improve this question


























      up vote
      11
      down vote

      favorite
      4









      up vote
      11
      down vote

      favorite
      4






      4





      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










      share|improve this question















      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







      ruby cucumber jenkins bundler






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 28 '12 at 18:38









      Savara

      1397




      1397










      asked Apr 28 '12 at 17:20









      Jonathan Chrisp

      1181214




      1181214
























          5 Answers
          5






          active

          oldest

          votes

















          up vote
          11
          down vote













          Depending on the way you installed Jenkins, it might be running as a separate user, typically as user jenkins. If you have installed bundle into a nonstandard directory which isn't in the default PATH, like /usr/local/bin, you need to:




          • Add /usr/local/bin to the PATH of the jenkins user (check ~jenkins/.bashrc) or

          • Configure PATH environment variable in Jenkins global configuration (or slave configuration if building on a slave) or

          • Modify the build script to refer to bundle using a full path name.






          share|improve this answer





















          • Hi, i added /bin/bash instead /usr/bin/bash was not available. I am using centos.
            – Chetan kapoor
            Jul 14 '17 at 9:28


















          up vote
          3
          down vote













          If bundle is installed in /usr/local/bin/bundle (determine this with which bundle) you could just add a symbolic link to bundle in /usr/bin like so:



          ln -s /usr/local/bin/bundle /usr/bin/bundle






          share|improve this answer




























            up vote
            2
            down vote













            First things to verify:




            • Make sure bundle is installed on the machine where Jenkins runs.

            • If it installed, make sure it's on the path for the user under which Jenkins runs


            (To verify path/environment: insert shell build step that runs env)






            share|improve this answer




























              up vote
              0
              down vote













              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:




              1. Deleting the .war file.

              2. Deleting the ~/.jenkins directory.


              I then reinstalled via home-brew, and bundle started working.






              share|improve this answer




























                up vote
                -1
                down vote













                You could see where is bundle is installed by running which bundle and run the bundle command from there






                share|improve this answer





















                  Your Answer






                  StackExchange.ifUsing("editor", function () {
                  StackExchange.using("externalEditor", function () {
                  StackExchange.using("snippets", function () {
                  StackExchange.snippets.init();
                  });
                  });
                  }, "code-snippets");

                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "1"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                   

                  draft saved


                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f10365792%2fcant-run-jenkins-build-bundle-command-not-found%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  5 Answers
                  5






                  active

                  oldest

                  votes








                  5 Answers
                  5






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes








                  up vote
                  11
                  down vote













                  Depending on the way you installed Jenkins, it might be running as a separate user, typically as user jenkins. If you have installed bundle into a nonstandard directory which isn't in the default PATH, like /usr/local/bin, you need to:




                  • Add /usr/local/bin to the PATH of the jenkins user (check ~jenkins/.bashrc) or

                  • Configure PATH environment variable in Jenkins global configuration (or slave configuration if building on a slave) or

                  • Modify the build script to refer to bundle using a full path name.






                  share|improve this answer





















                  • Hi, i added /bin/bash instead /usr/bin/bash was not available. I am using centos.
                    – Chetan kapoor
                    Jul 14 '17 at 9:28















                  up vote
                  11
                  down vote













                  Depending on the way you installed Jenkins, it might be running as a separate user, typically as user jenkins. If you have installed bundle into a nonstandard directory which isn't in the default PATH, like /usr/local/bin, you need to:




                  • Add /usr/local/bin to the PATH of the jenkins user (check ~jenkins/.bashrc) or

                  • Configure PATH environment variable in Jenkins global configuration (or slave configuration if building on a slave) or

                  • Modify the build script to refer to bundle using a full path name.






                  share|improve this answer





















                  • Hi, i added /bin/bash instead /usr/bin/bash was not available. I am using centos.
                    – Chetan kapoor
                    Jul 14 '17 at 9:28













                  up vote
                  11
                  down vote










                  up vote
                  11
                  down vote









                  Depending on the way you installed Jenkins, it might be running as a separate user, typically as user jenkins. If you have installed bundle into a nonstandard directory which isn't in the default PATH, like /usr/local/bin, you need to:




                  • Add /usr/local/bin to the PATH of the jenkins user (check ~jenkins/.bashrc) or

                  • Configure PATH environment variable in Jenkins global configuration (or slave configuration if building on a slave) or

                  • Modify the build script to refer to bundle using a full path name.






                  share|improve this answer












                  Depending on the way you installed Jenkins, it might be running as a separate user, typically as user jenkins. If you have installed bundle into a nonstandard directory which isn't in the default PATH, like /usr/local/bin, you need to:




                  • Add /usr/local/bin to the PATH of the jenkins user (check ~jenkins/.bashrc) or

                  • Configure PATH environment variable in Jenkins global configuration (or slave configuration if building on a slave) or

                  • Modify the build script to refer to bundle using a full path name.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 1 '12 at 18:05









                  sti

                  10.1k12025




                  10.1k12025












                  • Hi, i added /bin/bash instead /usr/bin/bash was not available. I am using centos.
                    – Chetan kapoor
                    Jul 14 '17 at 9:28


















                  • Hi, i added /bin/bash instead /usr/bin/bash was not available. I am using centos.
                    – Chetan kapoor
                    Jul 14 '17 at 9:28
















                  Hi, i added /bin/bash instead /usr/bin/bash was not available. I am using centos.
                  – Chetan kapoor
                  Jul 14 '17 at 9:28




                  Hi, i added /bin/bash instead /usr/bin/bash was not available. I am using centos.
                  – Chetan kapoor
                  Jul 14 '17 at 9:28












                  up vote
                  3
                  down vote













                  If bundle is installed in /usr/local/bin/bundle (determine this with which bundle) you could just add a symbolic link to bundle in /usr/bin like so:



                  ln -s /usr/local/bin/bundle /usr/bin/bundle






                  share|improve this answer

























                    up vote
                    3
                    down vote













                    If bundle is installed in /usr/local/bin/bundle (determine this with which bundle) you could just add a symbolic link to bundle in /usr/bin like so:



                    ln -s /usr/local/bin/bundle /usr/bin/bundle






                    share|improve this answer























                      up vote
                      3
                      down vote










                      up vote
                      3
                      down vote









                      If bundle is installed in /usr/local/bin/bundle (determine this with which bundle) you could just add a symbolic link to bundle in /usr/bin like so:



                      ln -s /usr/local/bin/bundle /usr/bin/bundle






                      share|improve this answer












                      If bundle is installed in /usr/local/bin/bundle (determine this with which bundle) you could just add a symbolic link to bundle in /usr/bin like so:



                      ln -s /usr/local/bin/bundle /usr/bin/bundle







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Aug 25 '16 at 13:59









                      Dan Herman

                      7731718




                      7731718






















                          up vote
                          2
                          down vote













                          First things to verify:




                          • Make sure bundle is installed on the machine where Jenkins runs.

                          • If it installed, make sure it's on the path for the user under which Jenkins runs


                          (To verify path/environment: insert shell build step that runs env)






                          share|improve this answer

























                            up vote
                            2
                            down vote













                            First things to verify:




                            • Make sure bundle is installed on the machine where Jenkins runs.

                            • If it installed, make sure it's on the path for the user under which Jenkins runs


                            (To verify path/environment: insert shell build step that runs env)






                            share|improve this answer























                              up vote
                              2
                              down vote










                              up vote
                              2
                              down vote









                              First things to verify:




                              • Make sure bundle is installed on the machine where Jenkins runs.

                              • If it installed, make sure it's on the path for the user under which Jenkins runs


                              (To verify path/environment: insert shell build step that runs env)






                              share|improve this answer












                              First things to verify:




                              • Make sure bundle is installed on the machine where Jenkins runs.

                              • If it installed, make sure it's on the path for the user under which Jenkins runs


                              (To verify path/environment: insert shell build step that runs env)







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Apr 28 '12 at 19:18









                              malenkiy_scot

                              14k64577




                              14k64577






















                                  up vote
                                  0
                                  down vote













                                  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:




                                  1. Deleting the .war file.

                                  2. Deleting the ~/.jenkins directory.


                                  I then reinstalled via home-brew, and bundle started working.






                                  share|improve this answer

























                                    up vote
                                    0
                                    down vote













                                    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:




                                    1. Deleting the .war file.

                                    2. Deleting the ~/.jenkins directory.


                                    I then reinstalled via home-brew, and bundle started working.






                                    share|improve this answer























                                      up vote
                                      0
                                      down vote










                                      up vote
                                      0
                                      down vote









                                      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:




                                      1. Deleting the .war file.

                                      2. Deleting the ~/.jenkins directory.


                                      I then reinstalled via home-brew, and bundle started working.






                                      share|improve this answer












                                      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:




                                      1. Deleting the .war file.

                                      2. Deleting the ~/.jenkins directory.


                                      I then reinstalled via home-brew, and bundle started working.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Nov 11 at 6:36









                                      Senseful

                                      44.5k42197312




                                      44.5k42197312






















                                          up vote
                                          -1
                                          down vote













                                          You could see where is bundle is installed by running which bundle and run the bundle command from there






                                          share|improve this answer

























                                            up vote
                                            -1
                                            down vote













                                            You could see where is bundle is installed by running which bundle and run the bundle command from there






                                            share|improve this answer























                                              up vote
                                              -1
                                              down vote










                                              up vote
                                              -1
                                              down vote









                                              You could see where is bundle is installed by running which bundle and run the bundle command from there






                                              share|improve this answer












                                              You could see where is bundle is installed by running which bundle and run the bundle command from there







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Mar 26 '17 at 2:43









                                              Maged Makled

                                              1,3141721




                                              1,3141721






























                                                   

                                                  draft saved


                                                  draft discarded



















































                                                   


                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f10365792%2fcant-run-jenkins-build-bundle-command-not-found%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  Xamarin.iOS Cant Deploy on Iphone

                                                  Glorious Revolution

                                                  Dulmage-Mendelsohn matrix decomposition in Python