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

using v8.beta-1 undefined method `thread_mattr_accessor' error #527

Closed
adrienpoly opened this issue Nov 27, 2023 · 5 comments
Closed

using v8.beta-1 undefined method `thread_mattr_accessor' error #527

adrienpoly opened this issue Nov 27, 2023 · 5 comments

Comments

@adrienpoly
Copy link
Member

While I was testing the beta I encountered an issue between turbo-rails and Rails generators

In a vanilla Rails 7.1 app when I run a scaffold

rails g scaffold post name:string

I have this error message

/Users/adrien/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/turbo-rails-2.0.0.pre.beta.1/lib/turbo-rails.rb:8:in `<module:Turbo>': undefined method `thread_mattr_accessor' for Turbo:Module (NoMethodError)

  thread_mattr_accessor :current_request_id
@adrienpoly adrienpoly changed the title using v8.beta-1 Rails generators are broken : undefined method `thread_mattr_accessor' using v8.beta-1 undefined method `thread_mattr_accessor' error Nov 27, 2023
@adrienpoly
Copy link
Member Author

I realized that this error occurs also when I start my Rails app. Looks like #519 is proposing a fix to this issue

@adrienpoly
Copy link
Member Author

as a temporary fix

adding this to my application.rb solved the error

require "active_support/core_ext/module/attribute_accessors_per_thread"

@adrienpoly
Copy link
Member Author

I check the demo provided by @jorgemanrubia. In the demo repo this error is not present. The difference with my app is that I use Propshaft. If I replace Sprockets by Propshaft in https://github.com/basecamp/turbo-8-morphing-demo then there is the same error. Hope this can help to fix

@1klap
Copy link

1klap commented Dec 5, 2023

+1 encountered the exact same issue with propshaft
and can confirm that #527 (comment) works as a workaround

@adrienpoly
Copy link
Member Author

actually this is already solved on main branch with #523

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

No branches or pull requests

2 participants