How do I change my Ruby version using RVM?

前端 未结 13 1121
我寻月下人不归
我寻月下人不归 2020-12-02 04:49

I am not able to switch the current Ruby version:

➜  ~  rvm list

rvm rubies

   ruby-1.9.2-p290 [ x86_64 ]
   ruby-1.9.3-p0 [ x86_64 ]

➜  ~  rvm use ruby-1         


        
相关标签:
13条回答
  • 2020-12-02 05:36

    This happened to me too. I had:

    export PATH=~/.rvm/bin:$PATH
    

    Added in my .bashrc.

    All I had to do was add another

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
    

    to the same file and it worked! Of course, you have to restart your terminal after that.

    0 讨论(0)
  • 2020-12-02 05:36

    To Change the Default Version of ruby:

    In Ubuntu 11.10
    please change your GNOME terminal setting :

    Go to Terminal and then follow the following instructions:

    1.  Edit > Profile Preferences
    2.  Open Title and Command Tab               
    3.  Check Run Command as a login Shell 
    4.  Restart terminal
    

    Run this command on terminal:

    rvm --default use ruby_Version
    
    0 讨论(0)
  • 2020-12-02 05:41

    The above solution will only work, if RVM is installed for the current user. A more general solution would use the RVM path variable:

    # The following code loads RVM as user or system install:
    [[ -s "$rvm_path/scripts/rvm" ]] && . "$rvm_path/scripts/rvm"
    
    0 讨论(0)
  • 2020-12-02 05:42

    To add all RVM functionality to your .bash_profile you should use following command:

    echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
    

    After that you should reload the current shell or open a new terminal session and type the following command to reload .bash_profile:

    source .bash_profile
    
    0 讨论(0)
  • 2020-12-02 05:43

    You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use /bin/bash --login as the command.

    0 讨论(0)
  • 2020-12-02 05:44

    Installing RVM, See here http://octopress.org/docs/setup/rvm/

    0 讨论(0)
提交回复
热议问题