Matt,
I recently went through the pain of trying to get CruiseControl to work with rvm and bundler. I'm not a build expert and would rather spend my time writing code. Unfortunately, the cruise control documentation has not been updated to reflect these new technologies. I teach a course where we have 25 student teams using a build machine and next year we will be switching to a different product.
Cruise Control and bundler ---
Chad Woolley and I had an email thread on the group about a month ago, please check it out. (Bundler and cruise control.rb 6/17/10, 7/14, 9/24) He had some very good suggestions, but I needed a little more explicit guidance. In the end, for me to get bundler to work with cruise control, this is what I did:
a) modify .cruise/projects/NAME/cruise_config.rb to execute a shell command. In this case, I choose project.build_command = '../build_my_app.sh' because my build scripts were not in source control. Since I was working with student teams, I wanted them all on the build machine. Perhaps next time I would put them in source control.
b) create build_my_app.sh
bundle install
ruby -e "require 'rubygems' rescue nil; require 'rake'; load '/Users/tsedano/cruisecontrol-1.4.0/tasks/cc_build.rake'; ARGV <<
'--nosearch' << 'cc:build'; Rake.application.run; ARGV.clear"
The first line runs bundle install as the cruise control unix user, the second line is the line that my cruise control normally executes; I got it from the build logs
I tried several variants to get bundler to work from lib/tasks/cruise.rake but was not successful. When cruise.rake executes it needs to have the rails environment ready, but it wasn't since bundle hadn't been run yet.
I'm sure there is a better way to do this, but I wasn't able to get it to work.
Cruise Control and rvm ---
As the command prompt, I was using bundler 1.0.2, but when cruise control was running, it was using bundler 0.9.6 for some projects -- I couldn't find how and where it was getting the wrong bundler from my filesystem. In the end, I disabled rvm, found the 0.9.6 gem, and then was able to uninstall it. I suspect that cruise control is running as a different user on my system. I decided not to reinstall rvm.
I briefly was considering switching to Hudson or Team City. While I was looking at those products, I came across this thread. If I had more time, I would try out some of the commands in their shell script to see if it would get Cruise Control to work well with rvm.
If you are able to get this to work, please post back to the group. Also, please try and find the cruise control website maintainers and get the official documentation updated. I would do that, but I'm not convinced this is the "right" way to solve the problem.
Todd