gemsurance icon indicating copy to clipboard operation
gemsurance copied to clipboard

This rubygem could not be found. (Gems::NotFound)

Open rocket-turtle opened this issue 5 years ago • 1 comments

Hi,

we use multiple gem Servers. (e.g https://rubygems.org and https://rails-assets.org) Since Version 1.2 of the gem https://github.com/rubygems/gems an exception is thrown if the gem could not be fetched:

  • https://github.com/rubygems/gems/commit/0f5a1933387f8d7cc27f651a9cc81eea36a1bf22
  • https://github.com/rubygems/gems/commit/fe18eb2c2671839b187261f75b2899c799a352d1

So now I get the error:

	 5: from .../gems/gemsurance-0.10.0/lib/gemsurance/gem_info_retriever.rb:139:in `block in retrieve'
	 4: from .../gems/gems-1.2.0/lib/gems.rb:17:in `method_missing'
	 3: from ...gems/gems-1.2.0/lib/gems/client.rb:26:in `info'
	 2: from .../gems/gems-1.2.0/lib/gems/request.rb:13:in `get'
	 1: from .../gems/gems-1.2.0/lib/gems/request.rb:57:in `request'
/.../gems/gems-1.2.0/lib/gems/request.rb:73:in `body_from_response': This rubygem could not be found. (Gems::NotFound)

It works when I change the file gemsurance-0.10.0/lib/gemsurance/gem_info_retriever.rb

        homepage_uri      = current_spec.homepage
        documentation_uri = ''
        source_code_uri   = ''

        begin
          info = ::Gems.info(active_spec.name)

          homepage_uri      = info['homepage_uri']
          documentation_uri = info['documentation_uri']
          source_code_uri   = info['source_code_uri']
        rescue StandardError => ex
          puts "#{self.class}.#{__method__}: Error while fetching Gem #{active_spec.name} - #{ex}"
        end

But I think this is not the best solution, because we should not ask the rubygems.org server for informations if we do not install the gem from this server.

rocket-turtle avatar Jan 03 '20 12:01 rocket-turtle

I am also having this problem when mixing git sources with rubygems sources in my Gemfile.

Bialogs avatar Mar 31 '20 14:03 Bialogs