Calling bundle update GEMNAME will update a lot more gems than you think. E.g. when you do this: bundle update cucumber-rails ... you might think this will only...

...is a dependency of cucumber-rails), which will break all your tests. The fix Bundler >= 1.14 has a --conservative flag. Using the conservative flag allows bundle update GEM to update...

To keep JavaScript sources small, it can sometimes make sense to split your webpack bundles. For example, if your website uses some large JavaScript library – say TinyMCE – which is only...

...up TinyMCE like this (code is somewhat simplified): // TinyMCE as part of the main bundle! import tinymce from 'tinymce/tinymce' // UI import 'tinymce/themes/silver' import 'tinymce/skins/ui/oxide/skin.min.css' // Plugin import 'tinymce/plugins/autoresize' up.compiler('[tinymce]', (element...

bundle outdated [--filter-major|--filter-minor|--filter-patch] Example output for bundle outdated --filter-major Other examples A useful flag is --strict as it will only list versions that...

...per group (test, development) are easier to do. Thus --groups might also be helpful. $ bundle outdated --strict --groups Outdated gems included in the bundle: ===== Without group ===== * actioncable (newest 5.2.6, installed...

Install the latest bundler version: gem install bundler Fetching bundler-2.3.5.gem Successfully installed bundler-2.3.5 1 gem installed Update the bundler version in Gemfile.lock: bundle update --bundler Confirm it worked:

...n2 Gemfile.lock BUNDLED WITH 2.3.5 Notes: Bundler should automatically detect the latest installed version. If it does not, you can specify your preferred version like so: bundle _2.1.2_ update --bundler...

bundler.io

Bundler so far ignored the version specified under BUNDLED_WITH in the Gemfile.lock. This had two annoying consequences: If the bundler version on your system was lower than in the...

...installed, if missing. This requires bundler 2.3 and rubygems 3.3 For more details, see: https://bundler.io/blog/2022/01/23/bundler-v2-3.html Suggested bundler version If you don't need to support older Ruby versions...

...has been activated A gem is activated if it is either in the current bundle (Gemfile.lock), or if you have manually activated it using Kernel#gem (old-school).

You can run bundle install in parallel. This might be helpful for development, where you often install many new gems when switching between projects. Find out the number of processors...

...Set the config in your ~/.bundle/config globally (replace 8 with your number of proccessors): bundle config jobs 8 Note If you suspect parallel execution for bundling issues, you can try...

...binaries for ease of installation. However, there is an issue on some versions of Bundler (at least 2.3.x) that makes it inconsistent which versions of a gem will be...

Why this happens On (very) old versions of Bundler, the Gemfile.lock could never indicate which version of a gem was installed, i.e. the Gemfile read nokogiri (1.12.5) although nokogiri...

...will take care of a few things: The new Ruby version is installed The Bundler version stated in the Gemfile.lock is installed Geordi is installed (for database dumps)

...is deployed, gems with native extensions are automatically re-installed. Because of the shared bundle path, only one patch-level Ruby version can have compatible gems at the same time...

makandra dev

Bundler allows you to specify the name of the Gemfile you want to bundle with the BUNDLE_GEMFILE environment variable. BUNDLE_GEMFILE=Gemfile.rails.7.2 bundle By default, bundler will look...

...and want to run automated tests against multiple rails versions. When you need to bundle one of your secondary Gemfiles, the solution above is the way to go.

Calling bundle update (without arguments) updates all your gems at once. Given that many gems don't care about stable APIs, this might break your application in a million ways...

...your gems using the applicable way below: Projects in active development Update the entire bundle regularily (e.g. once a week). This ensures that your libraries are up-to-date while...

...the groups cucumber and deploy, add the following to config/deploy/production.rb and config/deploy/staging.rb respectively: set :bundle_without, %w{development test cucumber deploy}.join(' ') Be aware, that gems that belong to two...

...are excluded, e.g. to exclude rspec in the following example, you will have to bundle without test and cucumber: group :test, :cucumber do gem 'rspec'

...on a server that has no access to the internet (especially rubygems.org) requires to bundle the gems into the repository itself. This requires to adjust the bundle config in the...

...you have to omit the "set": bundle config --local name value. See here: https://bundler.io/v1.17/man/bundle-config.1.html This will create a file .bundle/config with the following content. --- BUNDLE_PATH: "vendor/"

On application servers, gems are usually bundled into the project directory, at a location shared across deployments. This is usually shared/bundle inside your project's root directory, e.g. /var/www/your-project/shared/bundle/.

...you can't find that, take a look at current/.bundle/config and look for BUNDLE_PATH. When you are changing the version of RubyGems or Bundler on a system where gems...

umaar.com

Similar to the Webpack Bundle Analyzer, Chrome's new Lighthouse feature … … shows a visualisation of your JavaScript bundles. It's compatible with sourcemaps and is great for understanding large JavaScript...

...the structure of the productive Javascript code. Warning This will only work when your bundler emits source maps, which it may not do in production. Also you should bundle in...

...you will not be able to use the maximum versions Rubygems 1.8.30 and Bundler 1.17.3 with https://rubygems.org/ anymore. This is a result of a server certificate on December 5th...

...t modify frozen object Could not verify the SSL certificate for https://rubygems.org/* Bundler::Fetcher::CertificateFailureError: Could not verify the SSL certificate for https://index.rubygems.org/versions. Error fetching data...

Since May 2011 we are cutting new gems using Bundler, which is less painful than cutting gems using Jeweler. You know a gem was cut using Bundler if you see...

...the word Bundler in a gem project's Rakefile. This is how to update a gem that was cut using Bundler: Say git pull or check out a repository from...

...task does not work well with the command prompt for your OTP code with Bundler versions < 2.0.2. It just looks like the task is frozen: Workaround 1: Just type your...

...OTP code and hit enter, your gem is released afterwards. Workaround 2: Upgrade to Bundler >= 2.0.2.. Your supported Ruby versions for this gem must be >= 2.3. When rake release...

tl;dr: Ruby's Bundler environment is passed on to system calls, which may not be what you may want as it changes gem and binary lookup. Use Bundler.with_original...

...foo && bundle exec ruby -e "require %(rails) ; puts Rails.version" ) }' 3.2.13 If you want a completely Bundler-free environment, you can use Bundler.with_unbundled_env on modern Bundler (2.1+). If you...

...all vendored gems in to a temporary folder on the server and does a bundle install there. If you need to install gems from anothere Gemfile, just do it like...

BUNDLE_GEMFILE=Gemfile.something; install-gems-remotely my.server.com This script is part of our geordi gem on github. If you get a "ERROR: no tty present and no askpass program...

I had this error: > gem install bundler Successfully installed bundler-2.0.1 1 gem installed > bundle install Traceback (most recent call last): 2: from /home/henning/.rbenv/versions/2.5.1/bin/bundle:23:in ` ' 1: from /home/henning/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb...

...activate_bin_path' /home/henning/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) The cause was that Bundler 2 requires RubyGems...

makandra dev

Update RubyGems and Passenger Bundler requires Rubygems >= 1.3.6. Run gem update --system if you have an older version. It also is not compatible with older versions of passenger, so bring...

You don't need to change stuff that calls rake because rake is already Bundler-aware. Bundler replaces the Cucumber version hack We formerly used a hack to define...

So you're getting this failure when running bundle install on an older project: Your Gemfile.lock is corrupt. The following gems are missing from the DEPENDENCIES section: 'archive-tar-minitar...

This happens when you are using a new version of Bundler with a project that was bundled with a very old version of Bundler. For reasons unknown, the...

...to marry Rails and the copied gem. This notes describes what to do. With Bundler This is super-painful. If you just copy the gem to vendor/gems, Rails will complain...

...foolib-1-2-3.gem Now that you have a working gem in vendor/gems, you need to tell Bundler about it. In your Gemfile, change the gem's line to: gem 'foolib', :path => File.join...