Samer Buna
Samer Buna

Reputation: 9311

Extract bundled gems into system gems

This might sound as a strange thing to do. Is there a bundler way to extract the bundled gems (from a Gemfile or from .bundle) and install them as system gems outside of the bundler context?

Something like bundle package, but instead of caching them in vendor/cache, installs them as system gems.

Upvotes: 2

Views: 453

Answers (2)

Samer Buna
Samer Buna

Reputation: 9311

The new bundler does this by default

Upvotes: 1

nfm
nfm

Reputation: 20747

When you run bundle install your gems are installed to your BUNDLE_PATH (which defaults to ~/.bundle.

You can pass an argument specifying where you want to install your gems to; bundle install /usr/local/lib/bundle. From the user manual, "Further bundle commands or calls to Bundler.setup or Bundler.require will remember this location".

Of course, you'll need to use sudo to install to a system directory.

Is that what you're after?

Upvotes: 0

Related Questions