Rails: Your user account isn't allowed to install to the system RubyGems

William Entriken picture William Entriken · Mar 16, 2017 · Viewed 27.5k times · Source

I am running the command

bundle install

in a project folder. In some project folders it will produce an error and in other projects folders it will not produce an error. The error is:

Your user account isn't allowed to install to the system RubyGems

I know this can be fixed by following the recommended advice:

bundle install --path vendor/bundle

My question is why is the behavior inconsistent?

Answer

Antônio Medeiros picture Antônio Medeiros · Apr 8, 2018

In my case, I solved doing just what the error message suggests:

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/

So, instead of:

bundle install

I ran:

bundle install --path vendor/bundle

That was the solution for this guy.

The downside of that solution is that it creates a vendor folder inside the current folder, which can be added to .gitignore if it is to distribute the application through Git.