Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Ruby 1.9 Compatibility: Add missing require #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Ruby 1.9 Compatibility: Add missing require #37

wants to merge 3 commits into from

Conversation

kmcclellan
Copy link

Fixes a compatibility issue introduced by 96a6d94. Monitor needs to be explicitly required in Ruby 1.9.

Steps to reproduce:

$ sudo gem install ref -v 2.0.0
$ irb -r ref
/var/lib/gems/1.9.1/gems/ref-2.0.0/lib/ref/soft_reference.rb:26:in `<class:SoftReference>': uninitialized constant Ref::SoftReference::Monitor (NameError)
	from /var/lib/gems/1.9.1/gems/ref-2.0.0/lib/ref/soft_reference.rb:19:in `<module:Ref>'
	from /var/lib/gems/1.9.1/gems/ref-2.0.0/lib/ref/soft_reference.rb:1:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/ref-2.0.0/lib/ref.rb:19:in `<module:Ref>'
	from /var/lib/gems/1.9.1/gems/ref-2.0.0/lib/ref.rb:1:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
	from /usr/lib/ruby/1.9.1/irb/init.rb:281:in `block in load_modules'
	from /usr/lib/ruby/1.9.1/irb/init.rb:279:in `each'
	from /usr/lib/ruby/1.9.1/irb/init.rb:279:in `load_modules'
	from /usr/lib/ruby/1.9.1/irb/init.rb:20:in `setup'
	from /usr/lib/ruby/1.9.1/irb.rb:53:in `start'
	from /usr/bin/irb:12:in `<main>'

kmcclellan and others added 3 commits November 16, 2020 16:21
* Monitor needs to be explicitly required in Ruby 1.9
Use Travis's default rubygems/bundler for broader Ruby version compatibility.
@kmcclellan
Copy link
Author

For some additional context, monitor gets loaded by bundler, so this issue doesn't crop up in contexts that use bundle commands (e.g. bundle exec rake by the CI).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant