Baffled by RBENV install

Hi,

I hope someone can help me with this as I’ve been reinstalling and
uninstalling rbenv for several days without success.

Everything keeps telling me the install is fine, until I try and install
a gem. Then, instead of installing under the version of ruby I’m using,
I get an error that I don’t have write permission under the system
install of Ruby.

I’m running on a MAC and don’t want to mess around with the default
install. Here is the log of what I have been doing so far:

Install rbenv:

brew update
brew install rbenv ruby-build

Configuration:

rbenv init -

And copied path update to bash_profile:

PATH=“/Users/batkins/.rbenv/shims:${PATH}”
export PATH
eval “$(rbenv init -)”
rbenv rehash

Install Ruby 2.2.3

rbenv install 2.2.3
rbenv rehash

Checks:

which gem
/Users/batkins/.rbenv/shims/gem

Change to new version:

rbenv global 2.2.3
rbenv rehash
ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]

Install Bundler
gem install bundle
WARNING: You don’t have /Users/batkins/.gem/ruby/2.0.0/bin in your
PATH,
gem executables will not run.
Successfully installed bundle-0.0.1

Run bundle:

bundle
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Resolving dependencies…
Rubygems 2.0.14 is not threadsafe, so your gems will be installed one at
a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem
installation.
Using builder 3.2.2
Using mime-types-data 3.2015.1120
Using mini_portile2 2.0.0
Using rack 1.6.4
Using gherkin3 3.1.2
Using diff-lcs 1.2.5
Using multi_json 1.11.2
Using multi_test 0.1.2

Your user account isn’t allowed to install to the system Rubygems.
You can cancel this installation and run:

  bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your
password
and install the bundled gems to Rubygems using sudo.

Password:

So tried adding to path:

echo $PATH
/Users/batkins/.rbenv/shims:/Users/batkins/.rbenv/shims:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin/cucumber:/Users/batkins/.gem/ruby/2.0.0/bin

For some reason I have shims twice…

Of possible interest is that the error msg then changed to tell me that
I don’t have 2.2.0 in the path, so I added that as well…

Re installed bundler:

gem uninstall bundler
gem install bundle
Successfully installed bundle-0.0.1
1 gem installed

rbenv rehash

Run Bundle:

bundle
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Resolving dependencies…
Rubygems 2.0.14 is not threadsafe, so your gems will be installed one at
a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem
installation.
Using builder 3.2.2
Using mime-types-data 3.2015.1120
Using mini_portile2 2.0.0
Using rack 1.6.4
Using gherkin3 3.1.2
Using diff-lcs 1.2.5
Using multi_json 1.11.2
Using multi_test 0.1.2

Your user account isn’t allowed to install to the system Rubygems.
You can cancel this installation and run:

  bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your
password
and install the bundled gems to Rubygems using sudo.

Password:

My Gem env:

gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 2.4.5.1
  • RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 173) [x86_64-darwin14]
  • INSTALLATION DIRECTORY:
    /Users/batkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0
  • RUBY EXECUTABLE: /Users/batkins/.rbenv/versions/2.2.3/bin/ruby
  • EXECUTABLE DIRECTORY: /Users/batkins/.rbenv/versions/2.2.3/bin
  • SPEC CACHE DIRECTORY: /Users/batkins/.gem/specs
  • SYSTEM CONFIGURATION DIRECTORY:
    /Users/batkins/.rbenv/versions/2.2.3/etc
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-darwin-14
  • GEM PATHS:
    • /Users/batkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0
    • /Users/batkins/.gem/ruby/2.2.0
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :backtrace => false
    • :bulk_threshold => 1000
    • :sources => [“https://rubygems.org/”, “http://rubygems.org/”]
    • “install” => “–user --no-document”
    • “update” => “–user --no-document”
  • REMOTE SOURCES:
  • SHELL PATH:
    • /Users/batkins/.rbenv/versions/2.2.3/bin
    • /usr/local/Cellar/rbenv/0.4.0/libexec
    • /Users/batkins/.rbenv/shims
    • /Users/batkins/.rbenv/shims
    • /Library/Frameworks/Python.framework/Versions/3.4/bin
    • /Users/batkins/.rbenv/shims
    • /Users/batkins/.rbenv/shims
    • /Library/Frameworks/Python.framework/Versions/3.4/bin
    • /usr/local/bin
    • /usr/bin
    • /bin
    • /usr/sbin
    • /sbin
    • /usr/bin/cucumber
    • /Users/batkins/.gem/ruby/2.0.0/bin
    • /usr/bin/cucumber
    • /Users/batkins/.gem/ruby/2.0.0/bin
    • /Users/batkins/.gem/ruby/2.2.0/bin

Can anyone tell me why I keep using the System Ruby for installs?
Perhaps I just don’t understand, but I thought the idea was to be able
to have completely separate Ruby environments under rbenv?

I should add that I seem to be able to install gems using gem install
ok.