简体   繁体   English

在应用程序环境中未更新Ruby版本

[英]Ruby version is not updated in the applications enviroment

I updated ruby to 2.2.2 with rbenv 我用rbenv将ruby更新为2.2.2

$ruby -v $ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin13]

After I created a new rails application by rails new xxx and then rails server , 在通过rails new xxx然后通过rails server创建新的Rails应用程序之后, 在此处输入图片说明

Why the ruby version is still 2.0.0. 为什么ruby版本仍然是2.0.0。 How to fix this? 如何解决这个问题? Thanks 谢谢

You need to freeze Ruby version in two files: 您需要将Ruby版本冻结在两个文件中:

.ruby-version .ruby版本

2.2.2

This file created automatically if you type rbenv local 2.2.2 . 如果键入rbenv local 2.2.2,则会自动创建此文件。 The other file require to lock specific Ruby version is the following: 锁定特定Ruby版本所需的另一个文件如下:

Gemfile 的Gemfile

ruby '2.2.2'
...

Afterwards bundle install will fail in case of different Ruby version set as active. 之后,如果将其他Ruby版本设置为active,则捆绑安装将失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM