I have moved my active blog over to tumblr. I've maintained this blog for reference but will be posting to http://www.robustsoftware.co.uk instead. I've pointed my Feedburner feed to tumblr so if you're subscribed already you should already have switched with me.

Installing Ruby, Rails and RSpec on Ubuntu

So I had quite a nightmare with this one, but once I'd found the problem the installation was annoyingly simple. The crux of the problem is that Ubuntu's package manager will install old versions of both Rails and RubyGems that are not compatible with the latest version of RSpec and RSpec-Rails.

So, here's the steps I went through to go from nothing at all installed to a fully functioning Rails app with RSpec-Rails support:

  1. Use the package manager to install Ruby 1.8.7
  2. Manually download  the latest version of RubyGems from here (do NOT use the package manager for this)
  3. Extract and follow the instructions to install RubyGems
  4. Use RubyGems to install everything else:
  • [sudo] gem1.8 install rake
  • [sudo] gem1.8 install rails
  • [sudo] gem1.8 install rspec-rails

The last command will pull in the main RSpec gem as it is one of its dependencies.

Once you have created your rails app go to its directory run the command "script/generate rspec" then you're ready to rock and roll.