Take the following steps, by preference install this in a specific gemset

rvm gemset create rails31
rvm gemset use rails31
gem install bundler
gem install rails --pre

These steps will create a new gemset and start using it, then install bundler and rails 3.1 (which is still pre-release at the time of writing).

Now in rails 3.1 there is a new requirement: you will need a javascript runtime. You can see the full list here. If you are on linux and using straight ruby then therubyracer is just fine. Type

gem install therubyracer

Creating a new rails-project always poses the same problem: creating a new project, with your set of gems, which all have to installed, generators need to be ran … Rails Wizard solves that.

gem install rails_wizard

Type rails_wizard list to see all possible templates.

To create a new rails 3.1 project using jquery, rspec, haml, devise you just need to write:

rails_wizard new your_new_application_name -r jquery rspec haml devise 

To go full out on options, you could write:

rails_wizard new your_new_application_name -r jquery rspec haml devise sass settingslogic git

Note

If you are using a specific gemset for your project, please remember to add your javascript runtime (e.g. I used therubyracer) to your Gemfile.

… and you are ready to go! Happy coding :)