public
Last active

Instructions for setting up the prepackaged Rails test environment

  • Download Gist
rails_test_box_prepackaged.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
# These commands will help you setup the Rails test environment without problems
#
# MAKE SURE YOU HAVE VIRTUAL BOX INSTALLED http://www.virtualbox.org/wiki/Downloads
#
# 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://github.com/rails/rails.git
 
echo 'source :rubygems
group :virtualbox do
gem "vagrant", "0.3.4"
end' > Gemfile
 
bundle install
 
bundle exec vagrant box add rails_test_box 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. Start running the tests!
 
cd rails
bundle install
rake
ruby19.sh
Shell
1 2 3 4 5 6 7 8
# 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
rake

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.