Rails snippet: Get a local copy of rails

Working with rails a lot it is nice to have the codebase itself at hand and
runable to check out how things actually work. Getting setup is really easy
compared to a lot of other projects, actually there are just a couple of steps
to get up and running. First you need a machine with all the necessary stuff to
run everything included in rails, which is a lot so I recommend the rails dev
box
for this. This setup installs and
boots a virtual machine using vagrant and
virtualbox, so you need to install
both first. Afterwards clone the rails-dev-box repository

$ git clone https://github.com/rails/rails-dev-box.git

And setup the box itself, which will take a couple of minutes, depending on your
internet connection.

$ cd rails-dev-box
$ vagrant up

Next up its time to clone rails itself inside the rails-dev-box folder, so it is
available inside the VM. Now to dive into i.e. 3.2 checkout the right branch.

$ git clone https://github.com/rails/rails.git
$ git checkout -t origin/3-2-stable

Now you can SSH in and switch to the rails folder to continue

$ vagrant ssh
$ cd /vagrant/rails

Finally just like with every other modern rails app, just run

$ bundle install

To get every gem needed installed, and run

$ rake test

The tests will take a while (like with every modern rails app ;) ) and you can
be sure to have a valid rails installation.

Next up more on running tests.

Enjoy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s