Which Ruby version am I really running?

前端 未结 4 1105
[愿得一人]
[愿得一人] 2020-12-10 10:39

I\'m running Ubuntu 12.04 LTS, and installed Ruby via RVM.

The problem is, when I type ruby -v into the terminal, it says that my Ruby version is

4条回答
  •  庸人自扰
    2020-12-10 11:15

    On your terminal, try running:

    which -a ruby
    

    This will output all the installed Ruby versions (via RVM, or otherwise) on your system in your PATH. If 1.8.7 is your system Ruby version, you can uninstall the system Ruby using:

    sudo apt-get purge ruby
    

    Once you have made sure you have Ruby installed via RVM alone, in your login shell you can type:

    rvm --default use 2.0.0
    

    You don't need to do this if you have only one Ruby version installed.

    If you still face issues with any system Ruby files, try running:

    dpkg-query -l '*ruby*'
    

    This will output a bunch of Ruby-related files and packages which are, or were, installed on your system at the system level. Check the status of each to find if any of them is native and is causing issues.

提交回复
热议问题