Rails not using correct version of Ruby

后端 未结 9 2260
春和景丽
春和景丽 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:52

    Man, I was having this exact problem and the way I solved it was by reinstalling bundler. It seems that bundler was caching the RUBY_VERSION to 1.8.7.

    I'm not using rvm, I had to use this to set the default ruby version:

    sudo update-alternatives --config ruby
    sudo update-alternatives --config gem
    

    And then, I reinstalled bundler and it worked!

    Hopefully you can solve it with this approach

提交回复
热议问题