rails_panel
rails_panel copied to clipboard
Incompatible with Rails 7
Using Rails 7 and Ruby 3.0.3, created a new Rails 7 full stack app, added meta_request
to the Gemfile and ran bundler. Everything install as expected. Then tried to run rails db:create
and received the following error:
rails aborted!
SystemStackError: stack level too deep
/Users/scottknight/scott.projects/jobsauce-app/.gems/gems/activesupport-7.0.0/lib/active_support/core_ext/object/json.rb:180:in 'initialize_dup'
/Users/scottknight/scott.projects/jobsauce-app/.gems/gems/activesupport-7.0.0/lib/active_support/core_ext/object/json.rb:180:in 'dup'
/Users/scottknight/scott.projects/jobsauce-app/.gems/gems/activesupport-7.0.0/lib/active_support/core_ext/object/json.rb:180:in 'block in as_json'
/Users/scottknight/scott.projects/jobsauce-app/.gems/gems/activesupport-7.0.0/lib/active_support/core_ext/object/json.rb:179:in 'each'
/Users/scottknight/scott.projects/jobsauce-app/.gems/gems/activesupport-7.0.0/lib/active_support/core_ext/object/json.rb:179:in 'as_json'
/Users/scottknight/scott.projects/jobsauce-app/.gems/gems/activesupport-7.0.0/lib/active_support/core_ext/object/json.rb:63:in 'as_json'
I commented out all gems in the Gemfile and enabled them one by one, each time running bundler
then rails db:create
until I received the same error. When meta_request
was enabled, the error appeared again. When disabled (or removed), the error goes away. I have no idea why the gem would cause this error, but it is not compatible with Rails 7.
And I can not install it on a new Rails 7 app?!
Bundler could not find compatible versions for gem "railties":
In snapshot (Gemfile.lock):
railties (= 7.0.0)
In Gemfile:
meta_request (~> 0.7.3) was resolved to 0.7.3, which depends on
railties (>= 3.0.0, < 7)
rails (~> 7.0.0) was resolved to 7.0.0, which depends on
railties (= 7.0.0)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
If it helps, I was able to get past the stack overflow error like this: https://github.com/rails/rails/issues/44157#issuecomment-1013607633
But then my code crashes later on.
I'm also hitting the same errors w/ Rails 7.0.1.
Please advise.
Also encountering same issues.
same issues
Same issue with ruby 3.1.2p20 and Rails 7.0.3
It works if you set the gem's version to the master branch
@amrdruid thank you very much, as you said it works like this: gem 'meta_request', github: 'dejan/rails_panel', branch: 'master'
@elalemanyo Even better, you can use the version that is published in RubyGems
https://rubygems.org/gems/meta_request
gem 'meta_request', '~> 0.7.4'
@scott-knight If this fixes it for you feel free to close this issue
Issue is back with rails 7.1.0 beta, even while using meta_request 0.7.4
/usr/local/bundle/gems/activesupport-7.1.0.beta1/lib/active_support/core_ext/object/json.rb:188:in `block in as_json'
/usr/local/bundle/gems/activesupport-7.1.0.beta1/lib/active_support/core_ext/object/json.rb:187:in `each'
/usr/local/bundle/gems/activesupport-7.1.0.beta1/lib/active_support/core_ext/object/json.rb:187:in `as_json'
/usr/local/bundle/gems/activesupport-7.1.0.beta1/lib/active_support/core_ext/object/json.rb:63:in `as_json'
/usr/local/bundle/gems/activesupport-7.1.0.beta1/lib/active_support/json/encoding.rb:39:in `encode'
/usr/local/bundle/gems/activesupport-7.1.0.beta1/lib/active_support/json/encoding.rb:23:in `encode'
/usr/local/bundle/gems/activesupport-7.1.0.beta1/lib/active_support/core_ext/object/json.rb:42:in `to_json'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:48:in `block in json_encodable'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:74:in `block in transform_hash'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:68:in `each'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:68:in `each_with_object'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:68:in `transform_hash'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:71:in `block (2 levels) in transform_hash'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:70:in `fetch'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:70:in `block in transform_hash'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:68:in `each'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:68:in `each_with_object'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:68:in `transform_hash'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:40:in `json_encodable'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/event.rb:16:in `initialize'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/app_notifications.rb:54:in `new'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/app_notifications.rb:54:in `block in <class:AppNotifications>'
/usr/local/bundle/gems/meta_request-0.7.4/lib/meta_request/app_notifications.rb:82:in `block in subscribe'
@DmitrySychev Did you ever find a solution?
@elalemanyo, I haven’t, but I also haven’t actively looked into it. Had to stop using this gem and extension meanwhile.
@DmitrySychev I also quit using the gem. @amrdruid I don't mind closing this bug if people feel that the fixes described above actually work. However, if there isn't an actual fix, code should be updated to fix this issue.
On Rails 7.1.1 I got this error
Gemfile gem 'meta_request', github: 'dejan/rails_panel', branch: 'master'
ruby -v ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]
bundle
Could not find compatible versions
Because every version of meta_request depends on railties >= 3.0.0, < 7.1 and rails >= 7.1.1 depends on railties = 7.1.1, every version of meta_request is incompatible with rails >= 7.1.1. So, because Gemfile depends on rails >= 7.1.1 and Gemfile depends on meta_request >= 0, version solving has failed.
I really like this gem to find N+1 queries. Any alternatives?
@leoplct there are several pull requests solving this, for example https://github.com/dejan/rails_panel/pull/192
A bug fix for this issue has not been posted by the maintainers for nearly 2 years. I reached my frustration cap with this over a year ago and have since removed the gem from all of my projects. I'm closing this bug since there's a PR that appears to fix this issue.