Rails is not using my global Ruby version

蓝咒 提交于 2019-12-01 04:41:52
ivalkeen

You didn't tell how you installed rbenv, but I think it is per-user installation (which is default). In this case you should install gems without using sudo. When you did sudo gem install rails, it was installed in system ruby, not rbenv's selected one.

Solution - install rails without sudo:

rbenv global 2.1.0
gem install rails
rbenv rehash

Sounds silly, but did you restart terminal session?

Otherwise try and type

 /bin/bash --login

Try creating a .ruby-version file in the root of your project with the following contents:

2.1.0
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!