Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 301
Maximus S Avatar asked Jan 31 '16 09:01

Maximus S


People also ask

How do I fix a run bundle to install missing gems?

In the invoked popup, start typing bundler, select bundle install and press Enter . Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .

Where does bundler install gems?

Show activity on this post. I know that when using gem install , the gem will be stored under /home/username/. rvm/gems/, under which gemset the gem was installed.

How do I install a specific version of a gem?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.


1 Answers

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.

like image 171
Alesya Huzik Avatar answered Oct 13 '22 01:10

Alesya Huzik