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

前端 未结 6 2157
别那么骄傲
别那么骄傲 2020-12-31 06:18

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

相关标签:
6条回答
  • 2020-12-31 06:31

    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)

    0 讨论(0)
  • 2020-12-31 06:34

    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.

    0 讨论(0)
  • 2020-12-31 06:41

    In my case, I added this line to the first of script:

    #!/bin/bash -l
    
    0 讨论(0)
  • 2020-12-31 06:42

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

    0 讨论(0)
  • 2020-12-31 06:55

    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

    0 讨论(0)
  • 2020-12-31 06:56

    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.
    0 讨论(0)
提交回复
热议问题