Rails 3 with RVM and Cruise Control

October 26, 2010 Mike Barinek

Here are a few notes on how to get individual CruiseControl.rb project Builders running with RVM.

[Note: I’m making an assumption here that you know and understand Bundler and RVM.]

[Also: Cruise may or may not be running on RVM]

Create and check in a .rvmrc file in your rails root directory. Here’s an example.


rvm ruby-1.8.7-p174@rails-example

Then, add a project build command to your cruise_config.rb file.


Project.configure do |project|
  project.build_command = './cruise_build.sh'
end

Finally, create a cruise_build.sh file. The bash script setups rvm and just calls your cruise control build task.

[Note: Your cruise rake task should probably call Bundler’s “bundle install”.]


#!/bin/sh

source $HOME/.rvm/scripts/rvm && source .rvmrc

rake cc:build

…and your cruise project builder is now using RVM!

About the Author

Biography

More Content by Mike Barinek
Previous
Upgrading your Rakefile from RSpec 1.3 to RSpec 2
Upgrading your Rakefile from RSpec 1.3 to RSpec 2

I'm updating Erector to RSpec 2 and came across two problems for which solutions were surprisingly difficul...

Next
Interacting with AWS S3 in ruby…
Interacting with AWS S3 in ruby…

If you are looking for a ruby gem to interact with S3, you may want to choose the S3 gem over the AWS::S3 g...

Enter curious. Exit smarter.

Learn More