summaryrefslogtreecommitdiff
path: root/lib/bundler/setup.rb
AgeCommit message (Collapse)Author
2024-04-25[rubygems/rubygems] Add auto_install support to require "bundler/setup"Josh Nichols
We have some places that already use `bundle config auto_install true`, ie: https://github.com/technicalpickles/rubygems/blob/7a144f3374f6a400cc9832f072dc1fc0bca8c724/bundler/lib/bundler/cli.rb#L11 This applies the same logic (copy and pasted) to happen when you `require "bundler/setup"`. https://github.com/rubygems/rubygems/commit/bb3c922341
2023-12-16[rubygems/rubygems] Improve command suggestion when gems are missingDavid Rodríguez
Previous attempt to use a full path when the running version is different than the one that would be activated by default are different was not correct. This is because if this error happens in a `bundle exec` context, the `Gem.loaded_specs` is cleared because we're in an exec'd process, so will be always using a full path in these cases. This alternative approach should do what I was expecting. https://github.com/rubygems/rubygems/commit/e0bb8bf51b
2023-12-14[rubygems/rubygems] Improve install advice when some gems are not foundDavid Rodríguez
This problem is quite specific to our dev environment, but I guess the fix could be handy for other situations. After merging a change to treat default gems as regular gems, I get this when trying to run `rubocop` on our repo: ``` $ bin/rubocop --only Performance/RegexpMatch Could not find json-2.6.3 in locally installed gems Run `bundle install --gemfile /Users/deivid/code/rubygems/rubygems/tool/bundler/lint_gems.rb` to install missing gems. ``` However, when running the suggested command, nothing changes and I still get the same error: ``` $ bundle install --gemfile /Users/deivid/code/rubygems/rubygems/tool/bundler/lint_gems.rb Using ast 2.4.2 Using bundler 2.4.10 Using json 2.6.3 Using parallel 1.23.0 Using racc 1.7.1 Using parser 3.2.2.3 Using rainbow 3.1.1 Using regexp_parser 2.8.1 Using rexml 3.2.5 Using rubocop-ast 1.29.0 Using ruby-progressbar 1.13.0 Using unicode-display_width 2.4.2 Using rubocop 1.52.1 Using rubocop-performance 1.14.2 Bundle complete! 2 Gemfile dependencies, 14 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. $ bin/rubocop --only Performance/RegexpMatch Could not find json-2.6.3 in locally installed gems Run `bundle install --gemfile /Users/deivid/code/rubygems/rubygems/tool/bundler/lint_gems.rb` to install missing gems. ``` The problem is that our `bin/rubocop` script uses the development version of Bundler (which has the change causing the problem), but the advice recommands the default version of Bundler, which does not yet have the change. This commit changes the advice to recommend to use the same version of Bundler that run into the problem in the first place. So in the above situation you now get: ``` $ bin/rubocop --only Performance/RegexpMatch Could not find json-2.6.3 in locally installed gems Run `/Users/deivid/code/rubygems/rubygems/bundler/exe/bundle install --gemfile /Users/deivid/code/rubygems/rubygems/tool/bundler/lint_gems.rb` to install missing gems. ``` And running that fixes the problem: ``` $ /Users/deivid//rubygems/rubygems/bundler/exe/bundle install --gemfile /Users/deivid/code/rubygems/rubygems/tool/bundler/lint_gems.rb Fetching gem metadata from https://rubygems.org/......... Fetching json 2.6.3 Installing json 2.6.3 with native extensions Bundle complete! 2 Gemfile dependencies, 14 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. ``` https://github.com/rubygems/rubygems/commit/10a9588c6d
2023-03-07[rubygems/rubygems] Better suggestion when `bundler/setup` fails due to ↵David Rodríguez
missing gems If the original `BUNDLE_GEMFILE` is different from the default, then the suggestion wouldn't work as is. Before: ``` $ util/rubocop Could not find rubocop-1.30.1 in locally installed gems Run `bundle install` to install missing gems. $ rubygems git:(better-cmd-suggestion) ✗ bundle install Could not locate Gemfile ``` After: ``` $ util/rubocop Could not find rubocop-1.30.1 in locally installed gems Run `bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb` to install missing gems. $ bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb Fetching gem metadata from https://rubygems.org/......... Using ast 2.4.2 Using bundler 2.4.7 Using parser 3.1.2.0 Using rainbow 3.1.1 Using parallel 1.22.1 Using regexp_parser 2.5.0 Using rubocop-ast 1.18.0 Using rexml 3.2.5 Using ruby-progressbar 1.11.0 Using unicode-display_width 2.1.0 Fetching rubocop 1.30.1 Installing rubocop 1.30.1 Using rubocop-performance 1.14.2 Bundle complete! 2 Gemfile dependencies, 12 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. $ util/rubocop Inspecting 345 files ......................................................................................................................................................................................................................................................................................................................................................... 345 files inspected, no offenses detected ``` https://github.com/rubygems/rubygems/commit/bf1320d805
2021-08-31[rubygems/rubygems] Remove unnecessary escape sequencesDavid Rodríguez
Bundler formatters already take care of this. https://github.com/rubygems/rubygems/commit/c24415fdd5 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2019-12-18Merge bundler-2.1.1 from bundler/bundlerHiroshi SHIBATA
2019-11-11Merge Bundler 2.1.0.pre.3Hiroshi SHIBATA
Features: - Add caller information to some deprecation messages to make them easier to fix [#7361](https://github.com/bundler/bundler/pull/7361) - Reconcile `bundle cache` vs `bundle package` everywhere. Now in docs, CLI help and everywhere else `bundle cache` is the preferred version and `bundle package` remains as an alias [#7389](https://github.com/bundler/bundler/pull/7389) - Display some basic `bundler` documentation together with ruby's RDoc based documentation [#7394](https://github.com/bundler/bundler/pull/7394) Bugfixes: - Fix typos deprecation message and upgrading docs [#7374](https://github.com/bundler/bundler/pull/7374) - Deprecation warnings about `taint` usage on ruby 2.7 [#7385](https://github.com/bundler/bundler/pull/7385) - Fix `--help` flag not correctly delegating to `man` when used with command aliases [#7388](https://github.com/bundler/bundler/pull/7388) - `bundle add` should cache newly added gems if an application cache exists [#7393](https://github.com/bundler/bundler/pull/7393) - Stop using an insecure folder as a "fallback home" when user home is not defined [#7416](https://github.com/bundler/bundler/pull/7416) - Fix `bundler/inline` warning about `Bundler.root` redefinition [#7417](https://github.com/bundler/bundler/pull/7417) Notes: Merged: https://github.com/ruby/ruby/pull/2668
2019-06-09Merge bundler master from upstream.Hiroshi SHIBATA
Pick from 8dd59e3ba97eb80a599f8149f31bf40773b69dc0
2019-04-14Merge Bundler 2.1.0.pre.1 as developed version from upstream.hsbt
https://github.com/bundler/bundler/commit/a53709556b95a914e874b22ed2116a46b0528852 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-11Downgrade Bundler 1.17.x from 2.0.0.hsbt
We have the platform issue on heroku: * https://gist.github.com/schneems/26452540f6e2bbbcf2ea144f45f6b305 * https://github.com/heroku/heroku-buildpack-ruby/issues/833 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26Do not load rubygems when disablednobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02Added bundler as default gems. Revisit [Feature #12733]hsbt
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*: Merge from latest stable branch of bundler/bundler repository and added workaround patches. I will backport them into upstream. * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite of bundler. * tool/sync_default_gems.rb: Added sync task for bundler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22Postponing the Bundler merge.hsbt
I faced a big issue about Bundler with ruby core. I have no time to resolve it issue before 2.5 final release. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01Update bundled bundler to 1.16.0.hsbt
* lib/bundler, spec/bundler: Merge bundler-1.16.0. * common.mk: rspec examples of bundler-1.16.0 needs require option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-08Merge bundler to standard libraries.hsbt
rubygems 2.7.x depends bundler-1.15.x. This is preparation for rubygems and bundler migration. * lib/bundler.rb, lib/bundler/*: files of bundler-1.15.4 * spec/bundler/*: rspec examples of bundler-1.15.4. I applied patches. * https://github.com/bundler/bundler/pull/6007 * Exclude not working examples on ruby repository. * Fake ruby interpriter instead of installed ruby. * Makefile.in: Added test task named `test-bundler`. This task is only working macOS/linux yet. I'm going to support Windows environment later. * tool/sync_default_gems.rb: Added sync task for bundler. [Feature #12733][ruby-core:77172] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e