How to change gem environment settings?

后端 未结 1 1560
北恋
北恋 2020-12-29 07:24

I installed rbenv and set up ruby and gems. Now if I run gem env then I got the following:

RubyGems Environment:
  - RUBYGEMS VERSI         


        
相关标签:
1条回答
  • 2020-12-29 08:20

    Actually I searched online and found the solution.

    Just put the following in your .profile (Max OS) or .bashrc (Linux)

    export GEM_PATH=/Users/myusername/Tools/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0
    export GEM_SPEC_CACHE=/Users/myusername/Tools/.rbenv/versions/2.1.0/lib/ruby/gems/specs
    

    Make sure the folder you put there existed. Then source the .profile or .bashrc, or simply restart your terminal. It is tested working now my env is correct.

    Reference: https://github.com/rubygems/rubygems/pull/489

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