Rails new gives “Could not find proper version of

2019-07-01 13:34发布

问题:

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