您的 Ruby 版本是 2.3.1,但是您的 Gemfile 在运行 rails 时指定了 2.4.1 [英] Your Ruby version is 2.3.1, but your Gemfile specified 2.4.1 when running rails s

查看:56
本文介绍了您的 Ruby 版本是 2.3.1,但是您的 Gemfile 在运行 rails 时指定了 2.4.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 ruby​​ 2.3.0 升级到 2.4.1.为此,我使用 rvm use 2.4.1@my-project --create (我已经在另一个项目中使用了 2.4.1).我将 gemfile 从 ruby "2.3.0" 更改为 ruby "2.4.1",然后运行 ​​bundle install.我的 gemfile.lock 已正确更改.

I am trying to upgrade from ruby 2.3.0 to 2.4.1. To do this, I did rvm use 2.4.1@my-project --create (I am already using 2.4.1 for another project). I changed the gemfile from ruby "2.3.0" to ruby "2.4.1", and I ran bundle install. My gemfile.lock correctly changed.

但是,尝试在控制台中运行 rails 时,出现错误:

However, when trying to run rails s in console, I have the error:

Your Ruby version is 2.3.1, but your Gemfile specified 2.4.1

这不合逻辑,因为当我运行 which ruby​​ 时,我得到以下答案:/.rvm/rubies/ruby-2.4.1/bin/ruby.ruby -v 回答 ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux].此外,我从未将 2.3.1 用于我的任何项目;在控制台中运行 rvm list 时,我没有看到那个版本的 ruby​​.

This is not logical because when I am running which ruby I get the following answer : /.rvm/rubies/ruby-2.4.1/bin/ruby. ruby -v answers ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]. Furthermore I have never used 2.3.1 for any of my projects; when running rvm list in console, I do not see that version of ruby.

会不会和rails有冲突?我正在使用 Rails 4.2.7.1

Is it possible that there is a conflict with rails? I am using rails 4.2.7.1

我尝试了以下 stackoverflow 问题中给出的所有答案:

I tried all the answered given in the following stackoverflow issues:

所以我的想法有点用完了.感谢您的帮助!

So I am kind of running out of ideas. Thank you for your help!

推荐答案

我遇到了同样的问题,停止 spring 并清除 tmp,其中包括为我工作的 bootsnap 缓存

I faced same issue, stopping spring and clearing tmp, which includes bootsnap cache worked for me

spring stop
rake tmp:clear

这篇关于您的 Ruby 版本是 2.3.1,但是您的 Gemfile 在运行 rails 时指定了 2.4.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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