I installed rbenv
and set up ruby and gems. Now if I run gem env
then I got the following:
RubyGems Environment:
- RUBYGEMS VERSI
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