diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-07-26 15:49:28 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-08-31 19:06:14 +0900 |
commit | 570167eaa9084cec3b11fd3eca64955795835283 (patch) | |
tree | e5d12783b3eac7bc10b21a054650349e91417da3 /lib/bundler | |
parent | 81c06437629da422a7b6701a140b040af430b832 (diff) |
[rubygems/rubygems] Give a `bundle install` hint when `bundle list` fails
https://github.com/rubygems/rubygems/commit/98f5087e34
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/cli/list.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler/cli/list.rb b/lib/bundler/cli/list.rb index 66abd32650..f56bf5b86a 100644 --- a/lib/bundler/cli/list.rb +++ b/lib/bundler/cli/list.rb @@ -16,7 +16,13 @@ module Bundler specs = if @only_group.any? || @without_group.any? filtered_specs_by_groups else - Bundler.load.specs + begin + Bundler.load.specs + rescue GemNotFound => e + Bundler.ui.error e.message + Bundler.ui.warn "Install missing gems with `bundle install`." + exit 1 + end end.reject {|s| s.name == "bundler" }.sort_by(&:name) return Bundler.ui.info "No gems in the Gemfile" if specs.empty? |