Rails not using correct version of Ruby

后端 未结 9 2259
春和景丽
春和景丽 2021-02-14 15:20

New information

This is what happens with rails console:

Loading development environment (Rails 3.1.1)
ruby-1.9.2-p290 :001 &         


        
9条回答
  •  清酒与你
    2021-02-14 15:34

    You should set default ruby like:

    rvm use 1.9.2 --default
    

    This will override system installed ruby with rvm one.

    Updated:

    notme, thank you for remark

    Leading double hyphen before default is significant to set default ruby.

    Below listed detailed & self-explained example, enjoy:

    $ruby -v
    ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
    
    $rvm list
    rvm rubies
    
       ruby-1.9.2-p290 [ i386 ]
    
    $rvm use 1.9.2 --default
    Using /usr/local/rvm/gems/ruby-1.9.2-p290
    
    $rvm list default
    
    Default Ruby (for new shells)
    
       ruby-1.9.2-p290 [ i386 ]
    
    $rvm use default
    Using /usr/local/rvm/gems/ruby-1.9.2-p290
    
    $ruby -v
    ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
    
    $rvm list 
    
    rvm rubies
    
    => ruby-1.9.2-p290 [ i386 ]
    

提交回复
热议问题