I have set-up rbenv which sets my local version properly. However when I use executables like ruby or gem, it still uses (macos) system defaults
My rbenv local setup shows correctly
[(adikshit@LG962GRKWG) (25-08-14 14:03) (BasicRubyProject-v3.1.6)]:$ rbenv local
3.1.6
Just using gem still points to system default gem version. The gem and ruby executables under /usr/bin are MacOs default ruby binaries.
[(adikshit@LG962GRKWG) (25-08-14 14:04) (BasicRubyProject-v3.1.6)]:$ whence gem
/usr/bin/gem
Same with the ruby command
[(adikshit@LG962GRKWG) (25-08-14 14:05) (BasicRubyProject-v3.1.6)]:$ whence ruby
/usr/bin/ruby
However using rbenv gem command correctly points to the local gem version.
[(adikshit@LG962GRKWG) (25-08-14 14:05) (BasicRubyProject-v3.1.6)]:$ rbenv which gem
/Users/adikshit/.rbenv/versions/3.1.6/bin/gem
[(adikshit@LG962GRKWG) (25-08-14 14:05) (BasicRubyProject-v3.1.6)]:$
My understanding is that once I have setup a local environment and switch to the directory, all commands like ruby, gem etc will use the binaries of the local environment (in this case 3.1.6) and not the system defaults.
Am I missing something here? Thank you!
rbenv initand the close and reopen your terminal?rbenv-doctor, which you can find right here github.com/rbenv/rbenv-installer could help you. What happens when u userbenv global 3.1.6?