What Does It Mean Bundle_Disable_Shared_Gems: '1'

What does it mean BUNDLE_DISABLE_SHARED_GEMS: '1'?

Bundler takes some settings from the ~/.bundle/config file -- not from the shell env.

When set to true (default), the install of all gems will be to BUNDLE_PATH, regardless of whether those gems are installed in your system.

Bundler will not install gems already in system gems by default, so this is especially useful if you're trying to package up an application with all dependencies unpacked.

bundler: Using a custom path while using system gems is unsupported

The same happened to me today. I am pretty sure that there was no update to bundler or gem. The Docker image however has been updated (I was using ruby:2.6.3). I also added a new dependency when this started happening, so I suspect it was dependent on a gem which was already installed in the system path thus the error message.

You can get around it by specifying the following configuration variables in your .gitlab-ci.yml:

variables:
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_PATH__SYSTEM: "false"

This will configure Bundler to not use shared gems and disable system gems fully.

See https://bundler.io/v2.0/bundle_config.html

disable_shared_gems (BUNDLE_DISABLE_SHARED_GEMS): Stop Bundler from accessing gems installed to RubyGems' normal location.

and

path.system (BUNDLE_PATH__SYSTEM): Whether Bundler will install gems into the default system path (Gem.dir).

Ruby on rails 5; How to stop installing gem related files when I bundle install

The gem piet may be a dependency of another gem in your Rails project. When in doubt you can delete your copy of Gemfile.lock and run bundle again. It will auto-generate a new copy with the correct dependencies.

If you're working on a Rails project, it's totally normal for ~8,000 files to be installed since Rails itself relies on quite a few gems.

One way to cut down on the number of files installed by bundler is to skip the documentation within each gem. That can be accomplished by adding this to your local ~/.gemrc file

gem: --no-document

What does bundle install --without production do?

If you have a group inside your Gemfile like

group :production do
gem 'whatever'
end

Then when you run your bundle command on your development machine, it won't install the gems intended for use in your production environment. Basically only installing the gems you need in development on your development machine.

Bundler downloads gems present on the system?

Bundler doesn't go re-fetch gems unless one of these things is true:

  • You don't have the same gem and the same version (or allowed range of versions) installed.
  • You are using RVM and different gemsets for different projects and not placing them inside a global gemset.
  • The gem paths are not in the search path Bundler uses.

If this is an issue for you, you can use --local as you know to force Bundler never to even look for anything else, but you can also specify the versions for all your gems. And make sure the right version is in Gemfile.lock.

In the end, Bundler only does what you tell it to do. Of course, you can also not use Bundler.

bundler/capistrano is not installing gems with correct ruby version

This post helped me to understand the two possiblities to manage gem :

  • To put gems within the app folder
  • To put gems in separate gemsets

How to stop rails from adding BUNDLED WITH to the Gemfile.lock

After digging around a bit, and looking through those issues and comments shared by Jorge, you really only have two options:

  1. Downgrade your version of bundler to something earlier than 1.10
  2. Ask your whole team to update their versions of bundler to something later than 1.10

    gem uninstall bundler

    gem install bundler -v 1.9.9

But as long as the downgrade doesn't cause any issues, it should be fine.

The developers for the bundler gem are not going to make any changes to the gem that will eliminate this problem. They're reasoning is that eventually everyone will be upgraded to something after 1.10.

Bundle doesn't want to install a gem (not yet checked out)

Edit: You have to use rvm or rbenv to set ruby version. This is not set in the gem file. Ruby is not a gem.

This error might have one of many reasons.

From the Bundler issues

# remove user-specific gems and git repos
rm -rf ~/.bundle/ ~/.gem/bundler/ ~/.gems/cache/bundler/

# remove system-wide git repos and git checkouts
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/

# remove project-specific settings
rm -rf .bundle/

# remove project-specific cached gems and repos
rm -rf vendor/cache/

# remove the saved resolve of the Gemfile
rm -rf Gemfile.lock

# uninstall the rubygems-bundler and open_gem gems
rvm gemset use global # if using rvm
gem uninstall rubygems-bundler open_gem

# try to install one more time
bundle install


Related Topics



Leave a reply



Submit