diff options
Diffstat (limited to 'lib/bundler/cli/list.rb')
-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? |