macos 在 Snow Leopard 上安装 Ruby on Rails Beta 3 - 找不到文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2709683/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ruby on Rails Beta 3 Install on Snow Leopard - file not found
提问by Yolcu
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
成功安装 rails-3.0.0.beta3
1 gem 安装
安装 ri 文档为 rails-3.0.0.beta3 ...
找不到文件:lib
Since I'm very new to ruby, I really don't know what to do.
由于我对 ruby 很陌生,我真的不知道该怎么做。
How can I finish installing this? Is this installed already? Why does it abort here?
我怎样才能完成安装?这个已经安装了吗?为什么会在这里中止?
回答by balupton
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.
您只需要运行gem install rdoc
,按照其说明进行操作,然后再次运行 install rails 命令就可以了。问题是由于使用 rails 安装时 rdoc 无法安装,如果手动安装它工作正常。
Source: http://gist.github.com/565967
来源:http: //gist.github.com/565967
^ I had the same problem, and this worked for me.
^ 我遇到了同样的问题,这对我有用。
回答by Damien Wilson
If you're looking to do ruby/rails development on Mac, I'd strongly recommend notusing the version of ruby/rubygems shipped with your mac. What I do recommend is:
如果您想在 Mac 上进行 ruby/rails 开发,我强烈建议您不要使用Mac附带的 ruby/rubygems 版本。我推荐的是:
- Installing homebrewand using that to manage software packages on your mac.
- Install brewbygems, which makes homebrew play nice with rubygems:
gem install brewbygems
- Install rvmand learn to love the different versions of ruby and rvm's gemsets feature:
gem install rvm
- 安装自制软件并使用它来管理 Mac 上的软件包。
- 安装brewbygems,这使得自制软件可以很好地与 rubygems 配合使用:
gem install brewbygems
- 安装rvm并学会喜欢不同版本的 ruby 和 rvm 的 gemsets 功能:
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).
完成后,您将拥有一个非常健壮的开发环境,您应该能够毫无问题地安装任何版本的 rails。请记住,rails 3 在使用 ruby 1.9.2 时效果最佳(通过运行 rvm 安装rvm install ruby-head
)并且仍处于测试阶段,这意味着它不是非常稳定,不应用于任何生产级(尚)。
回答by chrismartinawesome
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.
我发现了相同的错误消息,而在一些谷歌之后,我已经通过在 .../gems/rails-3.0.0.beta3 中手动“sudo mkdir lib”成功安装了它。虽然它没有引起进一步的问题,但我希望有人能告诉丢失的 lib 目录中应该有什么。
回答by zengr
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.
你真的不需要这样做sudo gem install rails --pre
,很简单sudo gem install rails
。Rails3 是现在和测试版之外的默认包。
It should work fine.
它应该可以正常工作。
回答by Amin Ariana
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:
在您的操作系统上可能是不同的解决方案,但我在 Ubuntu 中遇到了完全相同的错误,并且在 rails gem 文件夹下创建了一个 ¨lib¨ 文件夹解决了我的问题。我在以下帖子中解释了解决方案:
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
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.
说明:¨[sudo] gem install rails¨ 命令需要 /lib 文件夹(在最后),但由于某种原因它还没有被创建。
The original source of this solution was the following URL. Hope it helps!
此解决方案的原始来源是以下 URL。希望能帮助到你!
回答by tommasop
follow this railscastand you'll be just fine.
按照这个 railscast,你会没事的。
It seems anyhow that the problem arises in the documentation which shouldn't prevent you from using rails 3.
无论如何,问题出现在不应阻止您使用 rails 3 的文档中。
回答by Mark Richman
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.
我在 beta 4 中遇到了同样的问题。解决方法是sudo gem install rails --pre --no-ri --no-rdoc
虽然我不知道为什么。