Skip to content

Commit 4c2c562

Browse files
eregonansalond
authored andcommitted
Ignore if did_you_mean cannot be registered as a gem
* Fixes issue when running TruffleRuby in TravisCI with the default `bundle install --jobs=3 --retry=3 --deployment`. (cherry picked from commit 5e9ff3f)
1 parent 2881b1b commit 4c2c562

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/patches/rubygems.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
if Truffle::Boot.get_option 'did_you_mean' and Truffle::Boot.get_option 'rubygems'
1818
begin
1919
gem 'did_you_mean'
20-
rescue LoadError => e
21-
Truffle::Debug.log_warning "#{File.basename(__FILE__)}:#{__LINE__} #{e.message}"
20+
rescue LoadError
21+
# Ignore, this happens when GEM_HOME and GEM_PATH are set and do not include
22+
# the default gem home. In such a case, did_you_mean was loaded already, but
23+
# it is no longer possible to register the Gem with RubyGems. This happens
24+
# for instance with 'bundle exec' after `bundle install --deployment`.
25+
nil
2226
end
2327
end

0 commit comments

Comments
 (0)