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:
- Use the package manager to install Ruby 1.8.7
- Manually download the latest version of RubyGems from here (do NOT use the package manager for this)
- Extract and follow the instructions to install RubyGems
- 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.