Skip to content
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

Upgrading tzinfo to 1.2.7 causes: undefined method untaint' for class Enumerable::Recursor' #295

Open
TylerRick opened this issue Sep 2, 2020 · 2 comments

Comments

@TylerRick
Copy link
Contributor

In my Rails project, when I upgraded tzinfo to 1.2.7 it caused this error whenever I tried to boot the app:

      facets/lib/core/facets/enumerable/recursively.rb:19:in `private': undefined method `untaint' for class `Enumerable::Recursor'

I was able to reproduce in more minimal context with:

      require 'tzinfo/ruby_core_support'
      class C; private :untaint; end

It looks like 'tzinfo/ruby_core_support' adds untaint method to Object using a refinement, which somehow isn't compatible with what facets does. Anyone have an idea how to fix this on the facets side?

Maybe as simple as just adding untaint as an exception to this line (which caused the error)?:

    instance_methods(true).each{ |m| private m unless /^(__|object_id$)/ =~ m.to_s }

but that seems brittle.

Why are we making these private anyway? Is there a better way we could do this? BasicObject?

@TylerRick
Copy link
Contributor Author

A workaround for now is to just lock to:

gem 'tzinfo', '1.2.5'

... but eventually we'll be forced to upgrade tzinfo, so we'll need an actual solution.

Has anyone come up with a better/actual solution to this?

@jash
Copy link

jash commented Feb 4, 2022

This is still happening. Any other ideas for fixing this?

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

No branches or pull requests

2 participants