How to set correct Ruby version in gem environment

后端 未结 1 1258
不知归路
不知归路 2021-01-19 06:07

Note: This question relates to How can I get bundler to use the Ruby version set by chruby and .ruby-version?.

Using chruby I have Ruby 1.8.7 installed

相关标签:
1条回答
  • 2021-01-19 07:07

    My missing step was installing RubyGems 1.6.2 from source. Following advice elsewhere from Dan Cheail, I did the following:

    curl -O https://rubygems.org/rubygems/rubygems-1.6.2.tgz
    

    (and then unzipped it)

    cd rubygems-1.6.2
    chruby ruby-1.8.7-p374
    ruby setup.rb
    gem update --system 1.8.25
    

    And then my RubyGems environment was fixed:

    $ gem env
    RubyGems Environment:
      - RUBYGEMS VERSION: 1.8.25
      - RUBY VERSION: 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin17.4.0]
      - INSTALLATION DIRECTORY: /Users/keithpitty/.gem/ruby/1.8.7
      - RUBY EXECUTABLE: /Users/keithpitty/.rubies/ruby-1.8.7-p374/bin/ruby
      - EXECUTABLE DIRECTORY: /Users/keithpitty/.gem/ruby/1.8.7/bin
      - RUBYGEMS PLATFORMS:
        - ruby
        - x86-darwin-17
      - GEM PATHS:
         - /Users/keithpitty/.gem/ruby/1.8.7
         - /Users/keithpitty/.rubies/ruby-1.8.7-p374/lib/ruby/gems/1.8
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :benchmark => false
         - :backtrace => false
         - :bulk_threshold => 1000
      - REMOTE SOURCES:
         - http://rubygems.org/
    
    0 讨论(0)
提交回复
热议问题