Igor.srs
Igor.srs

Reputation: 3

Does bundle package install gems globally

I used to have a new ruby installation for each new rails project, because it's impossible not to have conflicting gems with between two of them.

I have seen that 'bundle package' command could freeze a project specific set of gems in the 'vendr/cache' directory.

I though it wouldn't install them globally, just store them in that directory.

However, when i did it, 'bundle package' ended up installing (globally) the gems before storing them in 'vendor/cache' folder.

Did I do something wrong? Is it a bug?

Upvotes: 0

Views: 1324

Answers (1)

sarahhodne
sarahhodne

Reputation: 10114

From the Bundler docs:

The package command will copy the .gem files for your gems in the bundle into ./vendor/cache.

As far as I can tell, Bundler does not handle installing gems, it passes that off to the gem command. What Bundler does is to make sure that you have the right version of the gem activated. So even when you package the gems, when you later install them it'll take those gems and install them "globally".

So, to answer your question: No, you didn't do anything wrong and this is not a bug but the intended behaviour.

Upvotes: 1

Related Questions