Ruby on Rails Beta 3 Install on Snow Leopard - fil

2019-01-24 00:19发布

问题:

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?

回答1:

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.



回答2:

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).



回答3:

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.



回答4:

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.



回答5:

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.



回答6:

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



回答7:

I am having the same problem with beta 4. The workaround is sudo gem install rails --pre --no-ri --no-rdoc though I don't know why.