I had the same problem. I kept receiving the following error message:
$ sudo gem install rails
Successfully installed rails-3.0.7
1 gem installed
Installing ri documentation for rails-3.0.7...
File not found: lib
After a lot of messing around reinstalling ruby and googling for answers I finally came across Amin Ariana's answer, upon which I ran sudo mkdir /var/lib/gems/1.8/gems/rails-3.0.7/lib/
.
Success! Everything now works as expected:
$ sudo gem install rails
Successfully installed rails-3.0.7
1 gem installed
Installing ri documentation for rails-3.0.7...
Installing RDoc documentation for rails-3.0.7...
According to a similar StackOverflow answer, running sudo gem install rdoc
has the same effect.
NOTE: To actually run rails after installing via gem rather than apt, you'll need to add the gem library to your path in your ~/.bashrc
: /var/lib/gems/1.8/bin