Sunday, 7 February 2010

Installing Rails 3 and Bundler with RVM

These are just simple instructions, one way I found of doing things.  There are other ways, which may be slightly easier.  First step is RVM:


Next is Bundler. I'm doing this from the head of the master branch, is it contains recent bugfixes.


You should now have Bundler installed in the RVM environment. Finally, Rails. I'm doing this a slightly unusual way to bootstrap the Rails installation. I first create the rails appdir, and load it with a Gemfile. Then I use Bundler to install the gems. Finally, I back out of the app and use the rails command to generate over the app (telling it to use PostgreSQL as the database).


Watch out for the use of $GEM_HOME with the bundle command - the reason is explained on this GitHub issue

Finally, here is the Gemfile I used. It's an interim state between the one I have in my Merb app, and an ammendment of the one you get from the Rails app generator.


I have yet to get Cucumber, RSpec and Capybara working. The Cucumber & RSpec generators need updating and merging back into the main projects. I haven't looked at Capybara yet.