Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Auto merge of #4944 - dekellum:missing-require-rubygems-source, r=ind…
Browse files Browse the repository at this point in the history
…irect

[RubygemsExt] Add missing require rubygems/source

The change referenced below as released in 1.13.0.rc.2, may attempt to reference Gem::Source without it being loaded, resulting in:

~~~
  [!] There was an error parsing `Gemfile`:
  [!] There was an error while loading `elided.gemspec`: uninitialized constant Gem::Source. Bundler cannot continue.
~~~

Observed this on ruby 2.2.5 with stock rubygems 2.4.5 as well as upgraded rubygems 2.6.6. Add this require.

f9de70e  by @segiddins:
> [RubygemsExt] return Source::Installed from #source when appropriate
  • Loading branch information
homu committed Sep 10, 2016
2 parents 1908c7b + 34404bb commit 3b5d047
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/bundler/rubygems_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@

require "rubygems"
require "rubygems/specification"

begin
# Possible use in Gem::Specification#source below and require
# shouldn't be deferred.
require "rubygems/source"
rescue LoadError
# Not available before Rubygems 2.0.0, ignore
nil
end

require "bundler/match_platform"

module Gem
Expand Down

0 comments on commit 3b5d047

Please sign in to comment.