在 Snow Leopard 上安装 Ruby on Rails Beta 3 - 找不到文件

发布于 2024-08-30 08:51:04 字数 335 浏览 8 评论 0原文

我尝试使用以下命令在我的系统上安装新的测试版:

sudo gem install rails --pre

但无论我尝试什么,我仍然收到这个该死的错误:

安装成功 Rails-3.0.0.beta3
1 个 gem 已安装
正在安装ri 的文档 Rails-3.0.0.beta3...
文件不存在 发现:lib

由于我对 ruby​​ 很陌生,我真的不知道该怎么办。

我怎样才能完成安装? 这个已经安装了吗? 为什么会在这里中止?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

迷鸟归林 2024-09-06 08:51:04

您需要运行的只是gem install rdoc,按照其说明进行操作,然后再次运行 install Rails 命令即可。该问题是由于 rdoc 在与 Rails 一起安装时无法安装,如果手动安装则可以正常工作。

来源: http://gist.github.com/565967

^ 我遇到了同样的问题,这有效为我。

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.

一城柳絮吹成雪 2024-09-06 08:51:04

如果您想在 Mac 上进行 ruby​​/rails 开发,我强烈建议您不要使用 Mac 附带的 ruby​​/rubygems 版本。我建议的是:

  1. 安装 homebrew 并使用它来管理 Mac 上的软件包。
  2. 安装 brewbygems,这使得 homebrew 可以与 ruby​​gems 很好地配合: gem installbrewbygems
  3. 安装 rvm 并学会喜欢不同版本的 ruby​​ 和 rvm 的 gemsets 功能:gem install rvm< /code>

完成后,您将拥有一个非常强大的开发环境,并且您应该能够毫无问题地安装任何版本的 Rails。请记住,rails 3 使用 ruby​​ 1.9.2 效果最佳(通过运行 rvm install ruby​​-head 使用 rvm 安装),并且仍处于测试阶段,这意味着它不是很稳定,不应该使用对于任何生产级别的东西(还)。

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

最好是你 2024-09-06 08:51:04

我发现了同样的错误消息,而经过一些谷歌后,我通过手动“sudo mkdir lib”成功安装了它在.../gems/rails-3.0.0.beta3中。虽然它没有引发进一步的问题,但我希望有人能够告诉丢失的 lib 目录中应该有什么。

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.

指尖上得阳光 2024-09-06 08:51:04

您实际上并不需要执行此 sudo gem install Rails --pre,只需 sudo gem install Rails 即可。 Rails3 是现在的默认包,并且已经过测试版。

它应该工作正常。

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.

通知家属抬走 2024-09-06 08:51:04

在你的操作系统上可能是一个不同的解决方案,但我在 Ubuntu 中遇到了同样的错误,并在 Rails gem 文件夹下创建一个“lib”文件夹解决了我的问题。我在以下帖子中解释了解决方案:

安装 Rails:“找不到文件:lib”

为了方便起见,我也将其复制到这里。解决方案:

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

说明:“[sudo] gem install Rails”命令需要 /lib 文件夹(在最后),但由于某种原因它尚未创建。

该解决方案的原始来源是以下 URL。希望有帮助!

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

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

依 靠 2024-09-06 08:51:04

beta 4 也有同样的问题。

解决方法是 sudo gem install Rails --pre --no-ri --no-rdoc 尽管我不知道为什么。

Same problem with beta 4.

The workaround is sudo gem install rails --pre --no-ri --no-rdoc though I don't know why.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文