Matty
Matty

Reputation: 34433

What is the point of bundle package?

I understand what Rail's bundle package does and how to use it, but I'm drawing a blank as to why it would be a useful command. What utility does it have?

Upvotes: 5

Views: 3589

Answers (2)

Devin M
Devin M

Reputation: 9752

You would use it when you have a need to not connect to the gem source, its useful if your moving files across machines and don't want to fetch gems from a remote source all the time. See the documentation here.

Upvotes: 2

dexter
dexter

Reputation: 13583

bundle package will copy all the gems required by your application into the vendor/cache folder. This also includes dependencies required by the gems.

This helps because at the time of deployment you can just run bundle install --local to avoid dependency on the gems repository (rubygems.org) and install all the gems from the cached folder

Because each gem might have different dependencies depending upon the platform in which it is installed, it's recommended to use bundle package only when your development and deployment environments are alike.

Upvotes: 6

Related Questions