Rails new gives “Could not find proper version of railties (4.2.5.1) in any of the sources” error

主宰稳场 提交于 2019-12-10 18:26:10

问题


I am trying to use Rails 5.0.0.rc1 with Ruby 2.3.1. However, if I try to create a new project within my "programming" directory, I get this:

 ➜  ~/Documents/Programming  rails new foo
Could not find proper version of railties (4.2.5.1) in any of the sources
Run `bundle install` to install missing gems.

If I do a gem list, the only rails version I have installed in 5.0.0.rc1. What is interesting is I get the same error when I do rails -v, but do not when I do it from my home directory:

 ➜  ~  rails -v
Rails 5.0.0.rc1
 ➜  ~  cd Documents/Programming
 ➜  ~/Documents/Programming  rails -v
Could not find proper version of railties (4.2.5.1) in any of the sources
Run `bundle install` to install missing gems.

I have tried uninstalling and reinstalling both rails and railties with the same result. I am using rvm and had to do

gem install nokogiri -- --use-system-libraries

to install nokogiri.


回答1:


Run gem update rails first, then bundle update



来源:https://stackoverflow.com/questions/37117230/rails-new-gives-could-not-find-proper-version-of-railties-4-2-5-1-in-any-of-t

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