简体   繁体   中英

Ruby on Rails Beta 3 Install on Snow Leopard - file not found

I tried to install the new beta on my system with the command:

sudo gem install rails --pre

but no matter what I tried, I still get this damn error:

Successfully installed rails-3.0.0.beta3
1 gem installed
Installing ri documentation for rails-3.0.0.beta3...
File not found: lib

Since I'm very new to ruby, I really don't know what to do.

How can I finish installing this? Is this installed already? Why does it abort here?

All you need to run is gem install rdoc , follow its instructions, then run the install rails command again and you're good. The problem is due to rdoc failing to install when installed with rails, if installed manually it works fine.

Source: http://gist.github.com/565967

^ I had the same problem, and this worked for me.

If you're looking to do ruby/rails development on Mac, I'd strongly recommend not using the version of ruby/rubygems shipped with your mac. What I do recommend is:

  1. Installing homebrew and using that to manage software packages on your mac.
  2. Install brewbygems , which makes homebrew play nice with rubygems: gem install brewbygems
  3. Install rvm and learn to love the different versions of ruby and rvm's gemsets feature: gem install rvm

Once you've done that you'll have a pretty robust development environment and you should be able to install any version of rails without a problem. Just keep in mind rails 3 works best using ruby 1.9.2 (install with rvm by running rvm install ruby-head ) and is still in beta, meaning it isn't terribly stable and should not be used for anything production grade (yet).

I found the same error message, while after some google I've successfully installed it by manually 'sudo mkdir lib' in the .../gems/rails-3.0.0.beta3. Though it hasn't raised further problem, I hope someone could tell what should be in the missing lib directory.

follow this railscast and you'll be just fine.

It seems anyhow that the problem arises in the documentation which shouldn't prevent you from using rails 3.

You don't really need to do this sudo gem install rails --pre , simply sudo gem install rails . Rails3 is the default package now and out of beta.

It should work fine.

Might be a different solution on your OS, but I got the same exact error in Ubuntu and creating a ¨lib¨ folder under the rails gem folder solved my problem. I have explained the solution in the following post:

Installing Rails: "File not found: lib"

For convenience I will copy it here as well. The solution:

mkdir /lib/ruby/gems/1.8/gems/rails-{whatever your version is}/lib

Explanation: The ¨[sudo] gem install rails¨ command expects the /lib folder (at the end) but for some reason it hasn´t been created yet.

The original source of this solution was the following URL. Hope it helps!

http://www.spritle.com/blogs/?p=915

我对beta 4有同样的问题。解决方法是sudo gem install rails --pre --no-ri --no-rdoc虽然我不知道为什么。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM