无法找到宝石'铁轨'的头痛 [英] Could not find gem 'rails' headaches

查看:129
本文介绍了无法找到宝石'铁轨'的头痛的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Mac OS X 10.6 Snow Leopard。我刚刚更新了我的Ruby资料:

  sudo gem update 

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

  rails生成模型User 

失败,出现此错误:


无法在您的Gemfile中列出的任何gem源中找到gem'rails(= 3.0.3,runtime)'。
尝试运行 bundle install


code> bundle install rails 。它成功了!所以我试着运行 rails 。它失败了。所以我试着通过输入以下代码来获得Rails版本:

  rails -v 

这个错误失败了:


找不到rake-0.8 .7在任何来源

尝试运行捆绑安装


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

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

解决方案

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



即使您有一个版本,您的整个设置也不会正确安装。



卸载所有机架和版本确定你只有那一个。



正如贾斯汀在你的评论中所说,现在得到rvm。跑步,不要走路。


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.

解决方案

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.

这篇关于无法找到宝石'铁轨'的头痛的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆