简体   繁体   中英

RVM version of Ruby is different from Ruby -v

I'm trying to install the paperclip gem but I'm being prompted that it requires Ruby version >=1.9.2

When I check my version on RVM , I get 1.9.3, Whereas when I check it via the ruby -v command, I get 1.8.7 How do I get my rails application to use the latest version of RUby instead?

@ubuntu:~$ rvm list

rvm rubies

=* ruby-1.9.3-p194 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

@ubuntu:~$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

As a basic step you can set the default ruby rvm is to use as follows.

$ rvm use 1.9.3 --default

You can also set it at the project level by adding an .rvmrc file with the following contents to your project root directory. You should commit this to the repo.

rvm 1.9.3

As a final measure, you should stop using rvm and switch to rbenv . It's much better, and we need to stop overriding cd.

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