Ruby on rails error when running rails s

萝らか妹 提交于 2019-12-07 23:14:14

问题


Um quite new to rails and um getting an error when run the command rails s it says Could not find rake-0.9.2.2 in any of the sources Run bundle install to install missing gems. when I run bundle install nothing happened

my gem list has rake 0.9.2.2 what can go wrong? my ruby version is 1.9.3 Thank you in advance


回答1:


  1. Remove all the versions of Rake ==> gem uninstall rake
  2. Remove your gemfile.lock => rm Gemfile.lock
  3. Remove gem 'rake' on your gemfile
  4. Run bundle install
  5. Install Rake manually : gem install rake --version=10.0.4



回答2:


When you use command gem list, you will get a list of gem installed on your machine.

For example : rake (10.0.4, 10.0.3, 0.9.2.2)

Just see the console which gem is compatible with your application. It is already mentioned in the error log message.

Use

gem uninstall rake

Keep the suitable one and remove the version who is creating trouble. And then run rails s or bundle exec rails s




回答3:


Try using rvm and go back to ruby 1.8.7 instead of 1.9.2. This fixed it for me. Don't forget to install rails again (sudo gem install rails while already on 1.8.7) if you have only installed rails for 1.9.3.]



来源:https://stackoverflow.com/questions/16835641/ruby-on-rails-error-when-running-rails-s

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