找不到 gem“rails”;头痛

发布于 2024-10-08 22:29:07 字数 755 浏览 0 评论 0原文

我使用的是 Mac OS X 10.6 Snow Leopard。我刚刚使用以下方法更新了我的 Ruby 内容:

sudo gem update

不幸的是,它破坏了一切。当我尝试在我的网站目录中运行一个简单的命令时,例如:

rails generate model User

它失败了,并出现以下错误:

在 Gemfile 中列出的任何 gem 源中都找不到 gem“rails(= 3.0.3,运行时)”。 尝试运行bundle install

所以我尝试运行bundle install Rails。成功了!所以我尝试运行rails。它失败了。所以我尝试通过输入以下内容来获取 Rails 版本:

rails -v

失败并出现此错误:

在任何来源中都找不到 rake-0.8.7
尝试运行bundle install

但它不仅失败了,还在我的网站目录中创建了一个空文件夹 rails/ruby/1.8

这对我来说完全是一场灾难,因为我只是 Ruby 和 Ruby on Rails 的初学者,甚至是终端的初学者。任何帮助将不胜感激。谢谢。

I'm on Mac OS X 10.6 Snow Leopard. I just updated my Ruby stuff using:

sudo gem update

Unfortunately, it broke everything. When I try to run a simple command in my website directory, like:

rails generate model User

It failed, with this error:

Could not find gem 'rails (= 3.0.3, runtime)' in any of the gem sources listed in your Gemfile.
Try running bundle install.

So I tried running bundle install rails. It succeeded! So I tried running rails. It failed. So I tried getting the Rails version by entering:

rails -v

Which failed with this error:

Could not find rake-0.8.7 in any of the sources
Try running bundle install.

But not only did it fail, it also created an empty folder rails/ruby/1.8 in my website directory.

This is a complete disaster for me as I am just a beginner in Ruby and Ruby on Rails, and even in the Terminal. Any help would be MUCH appreciated. Thanks.

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

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

发布评论

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

评论(1

深者入戏 2024-10-15 22:29:07

所有这一切都源于机架版本不完全是 1.0.1 iirc。

即使您有之前的版本,您的整个设置也无法正确安装。

卸载所有版本的机架并确保您只有该版本。

正如贾斯汀在评论中所说,现在获取 RVM。跑,别走。

all this stems from having a version of rack that is not exactly 1.0.1 iirc.

Even if you have a version ahead of it, your whole setup will not install properly.

Uninstall all versions of rack and make sure you only have that one.

As Justin said in your comments, now get rvm. Run, don't walk.

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