Skip to content

Instantly share code, notes, and snippets.

@jeroenvandijk
Created May 4, 2010 16:32
Show Gist options
  • Save jeroenvandijk/389621 to your computer and use it in GitHub Desktop.
Save jeroenvandijk/389621 to your computer and use it in GitHub Desktop.
Instructions for setting up the prepackaged Rails test environment
The following will create a dir which contains the rails repo. You can start edit this later on. It will also create a Gemfile and a Vagrantfile. It will run bundle and it will download and activate the virtualbox that contains everything you need to start testing.
mkdir rails_test_box
cd rails_test_box
git clone git://github.com/rails/rails.git
echo 'source :rubygems
group :virtualbox do
gem "vagrant", "0.3.0"
gem "virtualbox", "0.6.0"
end' > Gemfile
bundle install
bundle exec vagrant add http://files.cookiestack.com/rails_test_env.box
echo 'Vagrant::Config.run do |config|
config.vm.share_folder("rails", "rails", "rails")
config.vm.box = "rails_test_box"
end' > Vagrantfile
bundle exec vagrant up
bundle exec vagrant ssh
Now you are in the Virtualbox. All you need to do now is go into the rails directory, run bundle install and your ready to test! If you want to test it for 1.9.1, you have to change to it using rvm and do a bundle install again. To summarize:
cd rails
bundle install
rake # to do all tests
rvm 1.9.1-p376 # to switch to 1.9.1 and use the following commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment