Rails new给出了“在任何来源中都找不到适当版本的Railties(4.2.5.1)".错误 [英] Rails new gives "Could not find proper version of railties (4.2.5.1) in any of the sources" error

查看:83
本文介绍了Rails new给出了“在任何来源中都找不到适当版本的Railties(4.2.5.1)".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Rails 5.0.0.rc1与Ruby 2.3.1结合使用.但是,如果我尝试在"programming"目录中创建一个新项目,则会得到以下信息:

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.

如果我做一个gem列表,那是我在5.0.0.rc1中安装的唯一的rails版本.有趣的是,当我使用rails -v时会遇到相同的错误,但是当我从主目录执行时却不会出现相同的错误:

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.

我尝试卸载并重新安装rails和railties,结果相同.我正在使用rvm,必须这样做

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

安装nokogiri.

to install nokogiri.

推荐答案

首先运行 gem更新轨道,然后运行捆绑更新

这篇关于Rails new给出了“在任何来源中都找不到适当版本的Railties(4.2.5.1)".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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