Ruby project with RVM fails
Ok,
I have configured a Ruby project in TeamCity to use RVM and run some cucumber test.
The error message received from TeamCity:
[16:15:02]Checking for changes
[16:15:02]Publishing internal artifacts
[16:15:02][Publishing internal artifacts] Sending build.start.properties.gz file
[16:15:02]Clearing temporary directory: /home/arne/TeamCity/buildAgent/temp/buildTmp
[16:15:02]Checkout directory: /home/arne/TeamCity/buildAgent/work/a4f34eb576a4a2ac
[16:15:02]Repository sources transferred
[16:15:02]Updating sources: server side checkout
[16:15:03]Step 1/3: Bundle installation (Command Line)
[16:15:03][Step 1/3] Starting: /home/arne/TeamCity/buildAgent/temp/agentTmp/custom_script1147713388805630079
[16:15:03][Step 1/3] in directory: /home/arne/TeamCity/buildAgent/work/a4f34eb576a4a2ac
[16:15:03][Step 1/3] /home/arne/TeamCity/buildAgent/temp/agentTmp/custom_script1147713388805630079: 1: rvm: not found
[16:15:03][Step 1/3] Process exited with code 127
[16:15:03][Step 1/3] Step Bundle installation (Command Line) failed
[16:15:03]Build step Touch Log files (Command Line) skipped because of previous step failure
[16:15:03]Build step features (Rake) skipped because of previous step failure
[16:15:03]Publishing internal artifacts
[16:15:03][Publishing internal artifacts] Sending build.finish.properties.gz file
[16:15:03]Build finished
The buildsteps are defined as followed for this project:
Step 1 : Command Line
-- Name : Bundle installation
-- Working Directory : blank
-- Run: Custom Script
-- Custom Script: rvm 1.9.3 && bundle install
Step 2: Command Line
-- Name: Touch log files
-- Working Directory : blank
-- Run: Custom Script
-- Custom Script: touch log/casserver.log && touch log/casserver_db.log
Step 3: Rake runner
configured for cucumber, to run a rake task called features under RVM 1.9.3 with no gemsets.
When I log in on the agent itself with the user that installed everything all RVM commands etc work fine.
So why is this complaining that RVM is not found.
Please sign in to leave a comment.
Hi Arne,
RVM may be not found beause bash running in non-login mode. ( "~/.bashrc" and "~/.bash_profile" does not applied ).
You can add ". ~/.bashrc" to your build script or use Ruby Environment Configurator build feature (recommended).
Resolved it by switching to Ubuntu.
Had alot of issues on Debian and FreeBSD. On Ubuntu it all seems to work fine for some reason