"File not found: lib" when installing rails-3.0.0

I got the following error when try to install rails-3.0.0 on my Ubuntu
box. Can anybody help?

[email protected]:~/Projects$ sudo gem install rails
Successfully installed rails-3.0.0
1 gem installed
Installing ri documentation for rails-3.0.0…
File not found: lib

[email protected]:~/Projects$ sudo gem install rails
Successfully installed rails-3.0.0
1 gem installed
Installing ri documentation for rails-3.0.0…
File not found: lib
[email protected]:~/Projects$ ruby gem
ruby: No such file or directory – gem (LoadError)
[email protected]:~/Projects$ gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.7
  • RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
  • INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: /usr/bin/ruby1.8
  • EXECUTABLE DIRECTORY: /usr/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-linux
  • GEM PATHS:
    • /usr/lib/ruby/gems/1.8
    • /home/dwang/.gem/ruby/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

I can verify this on ubuntu using those specs.

I installed rails 3 using ruby 1.9.2 and RVM. I suggest that as well.

http://rvm.beginrescueend.com/
There is a railscsts on rvm as well.

Brian

Solution:

$ cd /usr/lib/ruby/gems/1.8/gems/rails-3.0.3/
$ ls .

bin

if you have only “bin” directory:

$ sudo mkdir lib

$ sudo gem install rails

Sebastian

Hi,

I had the same problem with Ruby 1.9.2 and Rails 3.0.9.

Problem: “gem install rails” would always delete the “lib” folder, even
after manually creating it.

Solution: Creating a “.txt” file within the manually created “lib”
folder and opening that file in an editor. Now the file was gone after
“gem install rails” but at least the folder remained and the
installation ran through. :slight_smile:

Cheers,

Jens

Jens K. wrote in post #1009365:

Hi,

I had the same problem with Ruby 1.9.2 and Rails 3.0.9.

Problem: “gem install rails” would always delete the “lib” folder, even
after manually creating it.

Solution: Creating a “.txt” file within the manually created “lib”
folder and opening that file in an editor. Now the file was gone after
“gem install rails” but at least the folder remained and the
installation ran through. :slight_smile:

Cheers,

Jens

It not works, still delete the ‘lib’ folder if you have the permission
to write folder,
otherwise you can not install it if you no permission to write.