I've been fighting to get Ruby testing with RVM working in TeamCity 7.0.1. Here's my setup.
- Linux EC2 instance
- TeamCity web interface served via Tomcat running under the user, "tomcat".
- Build agent installed (via agent push) on the same machine under the user, "teamcity".
- The user "teamcity" has RVM installed at the user level, not system level. So rvm resides in ~teamcity/.rvm/bin.
- This RVM has the following ruby and gemset configured: ruby-1.9.3-p125@my_gemset.
My problem is that, depending on my build configuration, I receive the error that "RVM" cannot be found or that the gemset/interpretter do not exist. I've tried about ever permutation of build parameters, paths, build features, build steps, etc all to no avail. I then stripped my testing down to two basic cases. Both of these tests included the same build steps.
1. run "whoami"
2. run "ruby -v"
3. run "rvm list"
In the first test, I set the build feature to "RVM interpreter" and entered my ruby version and "my_gemset".
I also set the appropriate build parameters.
env.rvm_path: /home/teamcity/.rvm/bin (I also tried ~/.rvm/bin and other permutations with no success)
With these settings, the build fails on step 1, complaining that the interpretter or gemset cannot be found.
"[Step 1/3] Gemset 'my_gemset' isn't defined for Ruby interpreter 'ruby-1.9.3-p125' or the interpreter doesn't exist or isn't a file or isn't a valid RVM interpreter name."
I then tried to use the system Ruby and Global gemset, just to make sure the RVM functionality was working.
This time it failed on step 3, "rvm list" complaining that the command "rvm" could not be found.
[12:46:45]Step 1/3: Whoami (Command Line)
[12:46:45][Step 1/3] Starting: /bin/sh /home/teamcity/BuildAgent/temp/agentTmp/build7606554237867993998.sh
[12:46:45][Step 1/3] in directory: /home/teamcity/BuildAgent/work/6c8008638eb39563
[12:46:46][Step 1/3] teamcity
[12:46:46][Step 1/3] Process exited with code 0
[12:46:46]Step 2/3: Ruby Version (Command Line)
[12:46:46][Step 2/3] Starting: /bin/sh /home/teamcity/BuildAgent/temp/agentTmp/build8522733062657864515.sh
[12:46:46][Step 2/3] in directory: /home/teamcity/BuildAgent/work/6c8008638eb39563
[12:46:47][Step 2/3] ruby 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux]
[12:46:47][Step 2/3] Process exited with code 0
[12:46:47]Step 3/3: RVM List (Command Line)
[12:46:47][Step 3/3] Starting: /bin/sh /home/teamcity/BuildAgent/temp/agentTmp/build7737303470263275708.sh
[12:46:47][Step 3/3] in directory: /home/teamcity/BuildAgent/work/6c8008638eb39563
[12:46:48][Step 3/3] /home/teamcity/BuildAgent/temp/agentTmp/build7737303470263275708.sh: line 2: rvm: command not found
[12:46:48][Step 3/3] Process exited with code 127
[12:46:48][Step 3/3] Step RVM List (Command Line) failed
As I said, I feel like I've tried every possible permutation of build feature, build steps, build params, etc all with the same 2 outcomes. And anyone PLEASE offer some guidance on configuring 7.0.1 to work correctly with RVM? Thanks.