Forum: Ruby on Rails "File not found: lib" when installing rails-3.0.0

Posted by Dongsheng Wang (dongsheng)
on 2010-09-04 10:36
I got the following error when try to install rails-3.0.0 on my Ubuntu
box. Can anybody help?

dwang@dwang-bj-ws:~/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


dwang@dwang-bj-ws:~/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
dwang@dwang-bj-ws:~/Projects$ ruby gem
ruby: No such file or directory -- gem (LoadError)
dwang@dwang-bj-ws:~/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:
     - http://rubygems.org/
dwang@dwang-bj-ws:~/Projects$
Posted by PsiPro (Guest)
on 2010-09-06 16:39
(Received via mailing list)
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
Posted by Sebastian S. (sebastian_s)
on 2010-12-23 10:54
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
Posted by Jens K. (jens_k)
on 2011-07-06 20:15
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. :-)

Cheers,

Jens
Posted by coolesting d. (coolesting_d)
on 2011-07-16 04:39
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. :-)
>
> 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.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.