简体   繁体   中英

Ruby version is not updated in the applications enviroment

I updated ruby to 2.2.2 with rbenv

$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 , 在此处输入图片说明

Why the ruby version is still 2.0.0. How to fix this? Thanks

You need to freeze Ruby version in two files:

.ruby-version

2.2.2

This file created automatically if you type rbenv local 2.2.2 . The other file require to lock specific Ruby version is the following:

Gemfile

ruby '2.2.2'
...

Afterwards bundle install will fail in case of different Ruby version set as active.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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