RVM and Jenkins setup
continuous-integration, jenkins, ruby, ruby-on-rails-3, rvm
Solution
try:
. $(/home/RVM_USER/.rvm/bin/rvm env 1.9.3@rails-3.2.3 --path)
make sure you run the stable RVM:
rvm get stable
NOTE: Last Jenkins version does not always accept "source", but ".". RVM_USER is the user that installed RVM. Alternatively you can also export the RVM command in the main PATH.
Problem
I am new to Jenkins CI. I'm install RVM in my remote Jenkins and when I execute below shell. ``` #!/bin/bash -x source ~/.bashrc rvm use 1.9.3@rails-3.2.3 ``` I get following errors. ``` + source /var/lib/jenkins/.bashrc ++ PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/jenkins/.rvm/bin:/var/lib/jenkins/.rvm/bin + rvm use 1.9.3@rails-3.2.3 RVM is not a function, selecting rubies with 'rvm use ...' will not work. You need to change your terminal settings to allow shell login. Please visit https://rvm.io/workflow/screen/ for example. ``` What does it mean? I don't have any idea. Please help me. UPDATED: I'm tried below script but I still get errors: ``` #!/bin/bash -x source /home/zeck/.bashrc [[ -s ".rvmrc" ]] && source .rvmrc export RAILS_ENV=test bundle install ``` Errors: ``` /tmp/hudson457106939700368111.sh: line 5: bundle: command not found Build step 'Execute shell' marked build as failure Finished: FAILURE ``` Jenkins build shell can't detect RVM, gemsets and gems. What should I do? UPDATED 2: Therefore jenkins can't detect ruby. ``` + ruby -v /tmp/hudson2505951775163045158.sh: line 5: ruby: command not found Build step 'Execute shell' marked build as failure Finished: FAILUR ``` I'm not using any jenkins plugn and I'm just run script from Build->Execute shell section.