Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Instructions for setting up the prepackaged Rails test environment
# These commands will help you setup the Rails test environment without problems
# Copy paste all of following commands in your normal terminal and the following things will happen:
# - rails_test_box dir is created
# - rails master branch is checkout in the dir rails
# - A Gemfile is created and all the gems to run the virtualbox are installed using bundler
# - The rails vagrant box is downloaded and added to your vagrant boxes
# - A Vagrantfile is created for vagrant
# - The rails box will be activated, meaning it will be copied from your vagrant boxes directory and started
# - The 'vagrant ssh' makes you go into the box from now on all the commands are in the virtualbox until you type 'exit'
gem install bundler
mkdir rails_test_box
cd rails_test_box
git clone git://
echo 'source :rubygems
group :virtualbox do
gem "vagrant", "0.3.4"
end' > Gemfile
bundle install
bundle exec vagrant box add rails_test_box
echo ' do |config|
config.vm.share_folder("rails", "rails", "rails") = "rails_test_box"
end' > Vagrantfile
bundle exec vagrant up
bundle exec vagrant ssh
# Now you are in the Virtualbox. Start running the tests!
cd rails
bundle install
# To run the tests for 1.9.1-p376 do the following in the VirtualBox
# If you have logged out, you can log into the box again with 'vagrant ssh'
# (The bundle install only needs to be run the first time)
cd ~/rails
rvm 1.9.1-p376
bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment