-
-
Save dwabnitz/394452 to your computer and use it in GitHub Desktop.
Instructions for setting up a prepackaged rails test environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MAKE SURE YOU HAVE VIRTUAL BOX INSTALLED http://www.virtualbox.org/wiki/Downloads | |
# | |
# Copy paste this file in your terminal | |
# 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 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. 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 | |
# to run all tests | |
rake | |
# to switch to 1.9.1 use the following commands. For more options `rvm usage` | |
rvm 1.9.1-p376 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment