-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Gem::Version instances are silently created as singletons #2948
Comments
nobu
added a commit
to nobu/rubygems
that referenced
this issue
Oct 16, 2019
ghost
pushed a commit
that referenced
this issue
Oct 16, 2019
2949: Fix errors at frozen Gem::Version r=hsbt a=nobu # Description: Attempt to fix #2948 # Tasks: - [ ] Describe the problem / feature - [ ] Write tests - [ ] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md). Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Thanks! |
hsbt
pushed a commit
that referenced
this issue
Nov 11, 2019
2949: Fix errors at frozen Gem::Version r=hsbt a=nobu # Description: Attempt to fix #2948 # Tasks: - [ ] Describe the problem / feature - [ ] Write tests - [ ] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md). Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instantiating
Gem::Version
objects vianew
actually returns singletons, which is not obvious nor is this documented anywhere:Affected Ruby versions:
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-darwin17]
This feature can cause side-effects if the application freezes a
Gem::Version
that matches the version of one of the loaded gems.Error raised during
rails console
startup (notice thatjs_cookie_rails
is on the same version):Unfreezing the
SOME_VERSION
constant fixes the gemspec error.full-stack-trace.txt
Imported from the Ruby Lang bug tracker: https://bugs.ruby-lang.org/issues/16257
The text was updated successfully, but these errors were encountered: