Bundle install is using a different Ruby version?

后端 未结 1 674
礼貌的吻别
礼貌的吻别 2021-01-18 15:49

I tried to install Ruby 2.0.0-p353 on Vagrant using knife-solo. When I logged in as root and vagrant, ruby -v returns Ruby 2.0.0-p353.

However, when I r

相关标签:
1条回答
  • 2021-01-18 16:01

    Please do the following steps to fix the problem:

    1. Make sure that the following commands returns the proper version of ruby:

      $ rbenv versions
        system
        2.0.0-p353
      
      $ rbenv local
      ruby-2.0.0
      
      $ rbenv version
        2.0.0-p353
      
    2. Make sure that getting the version of ruby is correct:

      $ bundle exec ruby -v
      ruby 2.0.0-p353 (2013-11-22 revision 43784) [x86_64-linux]
      
    3. If you got invalid version of ruby, you shell to verify that problem is in bundler by calling:

      $ bundle exec ruby -v
      ruby 1.8.7
      
      $ which bundle
      /usr/bin/bundle
      

      It says that it will call system ruby to proceed ruby scripts.

    4. Reinstall bundler, and then make sure that now current ruby is valid:

      $ gem install bundler
      
      $ bundle exec ruby -v
      ruby 2.0.0-p353 (2013-11-22 revision 43784) [x86_64-linux]
      

    Also refer to how to properly set up a ruby project, which is being developed under rbenv/rvm here:

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