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

Load error with active_support 7 #2205

Closed
Annih opened this issue Dec 20, 2021 · 0 comments · Fixed by #2206
Closed

Load error with active_support 7 #2205

Annih opened this issue Dec 20, 2021 · 0 comments · Fixed by #2206

Comments

@Annih
Copy link
Contributor

Annih commented Dec 20, 2021

With recent release of active_support 7.0.0 my grape apps are not loading anymore.
It fails with the error uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState (NameError), with following backtace:

/home/<redacted>/.bundle/ruby/2.7.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:184:in `current_thread_backend': uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState (NameError)
from /home/<redacted>/.bundle/ruby/2.7.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:103:in `backend='
from /home/<redacted>/.bundle/ruby/2.7.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:201:in `<module:ActiveSupport>'
from /home/<redacted>/.bundle/ruby/2.7.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:11:in `<top (required)>'
from /home/<redacted>/.bundle/ruby/2.7.0/gems/activesupport-7.0.0/lib/active_support/core_ext/array/conversions.rb:3:in `require'
from /home/<redacted>/.bundle/ruby/2.7.0/gems/activesupport-7.0.0/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
from /home/<redacted>/.bundle/ruby/2.7.0/gems/grape-1.6.0/lib/grape.rb:15:in `require'
from /home/<redacted>/.bundle/ruby/2.7.0/gems/grape-1.6.0/lib/grape.rb:15:in `<top (required)>'

Someone reported an issue on rails (rails/rails#43851) and there even have been an attempt to fix it on this side; but it seems the issue is due to an incorrect way to require active_support's extensions.
According to this guide, it seems you should do a normal require 'active_support' prior to any more specific active_support import.

Annih added a commit to Annih/grape that referenced this issue Dec 20, 2021
It seems to be the recommended way with active_support >= 7.0.
See https://guides.rubyonrails.org/active_support_core_extensions.html#cherry-picking-a-definition

Fix ruby-grape#2205.

Signed-off-by: Baptiste Courtois <b.courtois@criteo.com>
dm1try pushed a commit to Annih/grape that referenced this issue Dec 21, 2021
It seems to be the recommended way with active_support.
See https://guides.rubyonrails.org/active_support_core_extensions.html#cherry-picking-a-definition

Fix ruby-grape#2205.

Signed-off-by: Baptiste Courtois <b.courtois@criteo.com>
ndp added a commit to ndp/thoreau that referenced this issue Dec 21, 2021
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

Successfully merging a pull request may close this issue.

1 participant