Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve gem not found in source error messages #4019

Merged
merged 1 commit into from Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundler/lib/bundler/resolver.rb
Expand Up @@ -302,7 +302,7 @@ def verify_gemfile_dependencies_are_found!(requirements)
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
message << if versions_with_platforms.any?
"The source contains '#{name}' at: #{formatted_versions_with_platforms(versions_with_platforms)}"
"The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}"
else
"The source does not contain any versions of '#{name}'"
end
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/commands/exec_spec.rb
Expand Up @@ -747,7 +747,7 @@ def bin_path(a,b,c)
let(:expected) { "" }
let(:expected_err) { <<-EOS.strip }
\e[31mCould not find gem 'rack (= 2)' in locally installed gems.
The source contains 'rack' at: 1.0.0\e[0m
The source contains the following versions of 'rack': 1.0.0\e[0m
\e[33mRun `bundle install` to install missing gems.\e[0m
EOS

Expand Down
6 changes: 3 additions & 3 deletions bundler/spec/install/gemfile/git_spec.rb
Expand Up @@ -87,7 +87,7 @@
gem "foo", "1.1", :git => "#{lib_path("foo-1.0")}"
G

expect(err).to include("The source contains 'foo' at: 1.0")
expect(err).to include("The source contains the following versions of 'foo': 1.0")
end

it "complains with version and platform if pinned specs don't exist in the git repo" do
Expand All @@ -103,7 +103,7 @@
end
G

expect(err).to include("The source contains 'only_java' at: 1.0 java")
expect(err).to include("The source contains the following versions of 'only_java': 1.0 java")
end

it "complains with multiple versions and platforms if pinned specs don't exist in the git repo" do
Expand All @@ -124,7 +124,7 @@
end
G

expect(err).to include("The source contains 'only_java' at: 1.0 java, 1.1 java")
expect(err).to include("The source contains the following versions of 'only_java': 1.0 java, 1.1 java")
end

it "still works after moving the application directory" do
Expand Down