-
Notifications
You must be signed in to change notification settings - Fork 188
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
Default gems can't be upgraded without booting RubyGems #1956
Comments
Thanks for the bug report. That's quite unfortunate because it means installing any of those gems will take precedence over the stdlib, and it means any script ran without Bundler/ I would be interested to hear if anyone gets a problem in practice due to this. |
FWIW we'd love to find a way around this too. This issue is why we had never explored the possibility of lazy RubyGems in JRuby, but the gains (as seen in the attached JRuby PR) are substantial. Folks shouldn't have to |
Similar to what you mentioned, probably the best way is for RubyGems to maintain an easy-to-parse file in a well-known location (so it can be found without loading the full RubyGems) containing the list of installed gems. |
|
Fixed in b9669c4 |
TruffleRuby currently lazy-loads RubyGems to improve startup. Unfortunately this means that unless RubyGems is forced to boot, default gems will not honor
gem install
ed upgrades.Default gems are installed in the standard library (so they are trivially loadable by
require
) but also have a specially-treated set of gemspecs. Those gemspecs are parsed by RubyGems at boot time so that upgraded default gems can be activated when the related standard libraries get required.The full set of default gems in TruffleRuby is visible here: https://github.com/oracle/truffleruby/tree/master/lib/gems/specifications/default
RubyGems can be forced to boot by running
bundle exec
or via a gem-based executable likerails
, but a simple Ruby script that requires a default gem-based standard library will not see upgraded versions of that library.This is important for a couple reasons:
bundler/setup
. By the time you require anything from thebundler/
subdir, it's too late to activate an upgraded bundler.json
orpsych
won't be honored even if the gems are installed.I do not have a fix to suggest, because it may not be possible (currently) to lazy load RubyGems and support always-upgradeable default gems.
Full disclosure: I implemented the default gem feature many years ago, and it is necessarily limited by the way RubyGems and
require
work.For a related example see jruby/jruby#6109 which adapts the same lazy logic to JRuby, and has the same impact on default gems.
The text was updated successfully, but these errors were encountered: