Could not find gem 'rails' headaches

偶尔善良 提交于 2019-12-11 23:49:10

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/4536380/could-not-find-gem-rails-headaches

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!