-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fix error seen when this gem installed but not specified as dependency in project #111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer require_relative
for loading internal files.
lib/rubygems_plugin.rb
Outdated
require 'gem/release' | ||
require 'rubygems/command_manager' | ||
begin | ||
require 'gem/release' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better solution would be to use require_relative
here. This is the answer for ensuring that libraries always load their internal files, rather than risking loading the wrong file via a load path search.
Took me a while to get it right |
Woohoo!! Thanks to much @PikachuEXE installing '2.2.3.alpha4' resolved this issue for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix released in https://rubygems.org/gems/gem-release/versions/2.2.3 |
Related issues
plugins/gem-release_plugin.rb": cannot load such file -- gem/release (LoadError)
rubygems/rubygems#5289To test:
gem uninstall gem-release
gem install gem-release -v '2.2.3.alpha4'
Update 1: Instead of rescuing
LoadError
, userequire_relative
as suggested in #111 (review)