Maximus S
Maximus S

Reputation: 11125

rbenv bundle install tries to install gems into wrong path

I get the following error message:

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.

And here are some inspections that I've done:

me at me-ui-MacBook-Pro in ~
$ rbenv versions
  system
  2.1.6
  2.2.3
* 2.3.0 (set by /Users/me/.rbenv/version)
  2.3.0-dev

me at me-ui-MacBook-Pro in ~
$ rbenv version
2.3.0 (set by /Users/me/.rbenv/version)

me at me-ui-MacBook-Pro in ~
$ gem environment home
/Users/me/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0

Q: why does it trying to install to system Rubygems?

Upvotes: 6

Views: 1824

Answers (1)

Alesya Huzik
Alesya Huzik

Reputation: 1640

I just had the same problem and this solved it for me:

gem uninstall bundler
gem update --system
rbenv rehash
gem install bundler

Most likely only gem update --system were mandatory.

Upvotes: 7

Related Questions