-
Notifications
You must be signed in to change notification settings - Fork 77
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
rails g forest_liana:install crash #536
Comments
hi @davidesantangelo Thank you for your feedback. |
I have just used version 7.4.5 but the problem is still there. Thanks |
I actually tried a clean install with rails 6.1.4.4 and ruby 3.0.1 and I'm not able to reproduce your issue. |
|
Could you please also share the Gemfile as well ? (not only the Gemfile.lock) |
|
Unfortunately, I am still not able to reproduce the issue with the provided Gemfile. |
I'm getting a similar error when running the install script. Gemfile
Output from command:
I'm not certain, but it appears that you may be eager loading classes out of order. Using
Monkey patching the
That got the actual initializer running, which led me to the following:
If I had to guess, you're not using the class loader correctly. Is there a version of this gem that is known to work with Rails 6 that we can use to evaluate Forest? |
On a fresh install with rails 6 and with your Gemfile, I can't reproduce the issue. Is your rails 6 a fresh install or an old rails 5 you migrated to rails 6 ?
Could you try adding Rails.autoloaders.main.ignore(Rails.root.join('lib/forest_liana')) to your config/application.rb? |
Just wanted to update. I am having this issue, too.
I am on:
The I even tried changing my Ruby version to This is what happens when I run Let me know if there's any way to get around it! We need an admin section soon, so it will make or break whether we use Forest Admin. |
Hi @dsomel21, Could you share here the result of the command: |
@matthv, I apologize for the late response. When I run
This hint isn't particularly useful; that line just points to the When I run it with
|
Unfortunately, we are not able to reproduce this issue internally. Can any of you share with me a repository to inspect and correct this old issue? |
Yes! I can hop on a call too, if it can help :) It's happening in our main SPG2 Repo in the |
I reproduced the issue on my end, thanks for your repo. I forced on the Gemfile to use de last version ~> 8.0 and the install command works correctly. However I had to comment the turbo-rails gem who have a uninitialized constant issue. |
Success!I did exactly what you said! Steps to fix my problem ✅
|
Expected behavior
the installer works correctly
Actual behavior
rails g forest_liana:install crash
Failure Logs
rails g forest_liana:install
/Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader/callbacks.rb:25:in
on_file_autoloaded': expected file /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/forest_liana-7.4.3/app/services/forest_liana/ip_whitelist_checker.rb to define constant ForestLiana::IPWhitelistChecker, but didn't (Zeitwerk::NameError) from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:28:in
block in require'from internal:kernel:90:in
tap' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:27:in
require'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader/helpers.rb:95:in
const_get' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader/helpers.rb:95:in
cget'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader.rb:232:in
block (2 levels) in eager_load' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader/helpers.rb:26:in
block in ls'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader/helpers.rb:18:in
each_child' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader/helpers.rb:18:in
ls'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader.rb:227:in
block in eager_load' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader.rb:212:in
synchronize'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader.rb:212:in
eager_load' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader.rb:312:in
each'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/loader.rb:312:in
eager_load_all' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/forest_liana-7.4.3/lib/forest_liana/engine.rb:72:in
eager_load_active_record_descendants'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/railties-6.1.4.4/lib/rails/railtie.rb:207:in
public_send' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/railties-6.1.4.4/lib/rails/railtie.rb:207:in
method_missing'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/forest_liana-7.4.3/lib/forest_liana/engine.rb:85:in
block in <class:Engine>' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/lazy_load_hooks.rb:68:in
block in execute_hook'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/lazy_load_hooks.rb:61:in
with_execution_control' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/lazy_load_hooks.rb:66:in
execute_hook'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/lazy_load_hooks.rb:52:in
block in run_load_hooks' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/lazy_load_hooks.rb:51:in
each'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/lazy_load_hooks.rb:51:in
run_load_hooks' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/railties-6.1.4.4/lib/rails/application/finisher.rb:140:in
block in module:Finisher'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/railties-6.1.4.4/lib/rails/initializable.rb:32:in
instance_exec' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/railties-6.1.4.4/lib/rails/initializable.rb:32:in
run'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/railties-6.1.4.4/lib/rails/initializable.rb:61:in
block in run_initializers' from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:228:in
block in tsort_each'from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:350:in
block (2 levels) in each_strongly_connected_component' from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:431:in
each_strongly_connected_component_from'from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:349:in
block in each_strongly_connected_component' from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:347:in
each'from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:347:in
call' from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:347:in
each_strongly_connected_component'from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:226:in
tsort_each' from /Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:205:in
tsort_each'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/railties-6.1.4.4/lib/rails/initializable.rb:60:in
run_initializers' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/railties-6.1.4.4/lib/rails/application.rb:391:in
initialize!'from /Users/davidesantangelo/Work/portal-v3/config/environment.rb:5:in
<main>' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in
require'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in
block in require_with_bootsnap_lfi' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/loaded_features_index.rb:100:in
register'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in
require_with_bootsnap_lfi' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in
require'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in
require' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:332:in
block in require'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:299:in
load_dependency' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:332:in
require'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/spring-2.1.1/lib/spring/application.rb:106:in
preload' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/spring-2.1.1/lib/spring/application.rb:157:in
serve'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/spring-2.1.1/lib/spring/application.rb:145:in
block in run' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/spring-2.1.1/lib/spring/application.rb:139:in
loop'from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/spring-2.1.1/lib/spring/application.rb:139:in
run' from /Users/davidesantangelo/.rvm/gems/ruby-3.0.1/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in
<top (required)>'from internal:/Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb:85:in
require' from <internal:/Users/davidesantangelo/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
require'Context
TODO: Please provide any relevant information about your setup.
The text was updated successfully, but these errors were encountered: