Rbenv clobbering my gem INSTALLATION DIRECTORY while using the system

I want to use rbenv to install ruby ​​versions for a project on a project. Otherwise, I want to use the default ruby ​​system setting for everything else.

The problem I am facing is that even if the command rbenv version

returns system

, gem

it still uses rbenv shim ( .rbenv/shims/gem

). So when I do gem environment

, my INSTALLATION INSTALLATION '/Library/Ruby/Gems/1.8'

. I would have preferred that he stayed ~/.gem/

. I can still see that at startup /usr/bin/gem enviroment

. I can't figure out where the rbenv shim gem settings came from.

I've tried modifying my GEM_HOME in both my shell and changing it in ~/.gemrc

, but that has no effect. I searched around with no luck. Hope someone here can help. Only a few pointers to where the rbenv gem shim is pulling its values ​​would be helpful.

thank

+3


source to share


1 answer


Since the rbenv shims are quite high in your PATH, their purpose is to intercept any call ruby

, gem

and the like, even if the currently selected Ruby version is the "system". You don't have to worry about this.

Now the default install path for your Ruby system will always be /Library/Ruby/Gems/1.8

. Here's mine RBENV_VERSION=system gem env

:



  - GEM PATHS:
     - /Library/Ruby/Gems/1.8
     - /Users/mislav/.gem/ruby/1.8
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

      

However, if you do not use sudo

(and do not), gem install

you will not be eligible for entry in this directory, and will install gems in the next recording path, which is equal to ~/.gem/ruby/1.8

. This is similar to the behavior you want.

+4


source







All Articles