Ruby 1.9.2 keeps reverting back to 1.8.7 after installing it using RVM

房东的猫 提交于 2019-12-30 11:16:11

问题


I installed Ruby 1.9.2. I used rvm use 1.9.2 and then when I type ruby -v it says 1.9.2. Then when I quit terminal and reopen it, it says 1.8.7 again.

What am I doing wrong?


回答1:


Your default ruby is most likely not set to ruby 1.9.2. Try:

rvm --default use 1.9.2

Also if you want to see all ruby versions installed, you can run 'rvm list'. The default ruby is prefixed with a => symbol, as shown below.

$ rvm list

rvm rubies

   ruby-1.9.1-p243 [ x86_64 ]
=> ruby-1.9.2-p136 [ x86_64 ]
   ruby-1.9.2-p180 [ x86_64 ]



回答2:


Once you switch over using rvm --default use 1.9.2, be sure to check your gem list. Once you switch over, your gem list will be almost empty.

Additionally, you can check to see more information regarding what version of ruby and gemset you're using with the command rvm info.

If it is in fact empty, simply install rails with the command gem install rails. Be sure to not use sudo with this command.



来源:https://stackoverflow.com/questions/5876764/ruby-1-9-2-keeps-reverting-back-to-1-8-7-after-installing-it-using-rvm

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