When a job tries to execute it fails with the following:
gitlab-ci-multi-runner 0.4.2 (1e86428)Using Shell executor...stdin: is not a ttyRunning on ci-runner...Fetching changes...Checking out f8858e83 as master...whoamirootecho $PATH/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/binrbenv local 1.9.3-p551builds/95c60cbb/0/xxx/xxxx.sh: line 27: rbenv: command not foundBuild failed with exit status 127
If I check $PATH as root on the ci-runner machine I have: /root/.rbenv/plugins/ruby-build/bin:/root/.rbenv/shims:/root/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
The multi-runner script is being run as a service and is started using sudo gitlab-ci-multi-runner start
Update Added /root/.rbenv/bin to $PATH but now just get
gitlab-ci-multi-runner 0.4.2 (1e86428)Using Shell executor...stdin: is not a ttyRunning on ci-runner...Fetching changes...Checking out f8858e83 as master...export PATH="/root/.rbenv/bin:$PATH"rbenv local 1.9.3-p551rbenv: version `1.9.3-p551' not installedBuild failed with exit status 1
Ruby 1.9.3-p551 is installed though.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
gitlab-ci-multi-runner 0.4.2-40-g5a89885-beta (5a89885)Using Shell executor...Running on ci-runner...Fetching changes...Checking out b05c4515 as master...echo $HOME/home/gitlab_ci_multi_runnerwhoamigitlab_ci_multi_runnerwhich rbenvBuild failed with exit status 1
I've logged in as gitlab_ci_multi_runner and installed rbenv for that user. I can run which rbenv locally, as the user, and it returns /home/gitlab_ci_multi_runner/.rbenv/bin/rbenv
gitlab-ci-multi-runner 0.4.2-40-g5a89885-beta (5a89885)Using Shell executor...Running on ci-runner...Cloning repository...Cloning into 'builds/261379c9/0/xxx/xxxx'...Checking out b05c4515 as master...echo $HOME/home/gitlab_ci_multi_runnerwhoamigitlab_ci_multi_runnerwhich rbenvBuild failed with exit status 1
gitlab-ci-multi-runner 0.4.2-44-gef6ab4c-beta (ef6ab4c)Using Shell executor...Running on ci-runner...Cloning repository...Cloning into 'builds/02c0a019/0/xxx/xxxx'...Checking out b05c4515 as master...echo $HOME/home/gitlab_ci_multi_runnerwhoamigitlab_ci_multi_runnerwhich rbenvBuild failed with exit status 1
gitlab-ci-multi-runner 0.4.2-44-gef6ab4c-beta (ef6ab4c)Using Shell executor...Running on ci-runner...Fetching changes...Checking out b05c4515 as master...echo $HOME/home/gitlab_ci_multi_runnerwhoamigitlab_ci_multi_runnertype rbenvbuilds/02c0a019/0/xxx/xxxx.sh: line 27: type: rbenv: not foundBuild failed with exit status 1
Have to leave the office now but let me know if there's anything I should try tomorrow.
Nope. This is not part of runner. You have some specific (not yet know to me) problem with login shell. Generally you shouldn't have to set the PATH manually.
gitlab_ci_multi_runner@ci-runner:~$ rbenvrbenv 0.4.0-151-g83ac0fbUsage: rbenv <command>[<args>]Some useful rbenv commands are: commands List all available rbenv commandslocal Set or show the local application-specific Ruby version global Set or show the global Ruby version shell Set or show the shell-specific Ruby versioninstall Install a Ruby version using ruby-build uninstall Uninstall a specific Ruby version rehash Rehash rbenv shims (run this after installing executables) version Show the current Ruby version and its origin versions List all Ruby versions available to rbenv which Display the full path to an executable whence List all Ruby versions that contain the given executableSee `rbenv help <command>' for information on a specific command.For full documentation, see: https://github.com/sstephenson/rbenv#readme
ai@ci-runner:~$ echo rbenv | sudo su --login-s /bin/bash gitlab_ci_multi_runner -su: line 1: rbenv: command not foundai@ci-runner:~$ sudo echo rbenv | sudo su --login-s /bin/bash gitlab_ci_multi_runner -su: line 1: rbenv: command not found
I do have a .profile, but no mention of rbenv in here:
# ~/.profile: executed by the command interpreter for login shells.# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login# exists.# see /usr/share/doc/bash/examples/startup-files for examples.# the files are located in the bash-doc package.# the default umask is set in /etc/profile; for setting the umask# for ssh logins, install and configure the libpam-umask package.#umask 022# if running bashif [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fifi# set PATH so it includes user's private bin if it existsif [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH"fi
I'm having this issue now with phpenv which actually uses rbenv. I tried having the following in my .bashrc.bash_profile and .profile neither of them worked.