Closed yrashk closed 1 year ago
Hi @yrashk thanks for the PR. I just had another look at https://github.com/tansengming/stripe-rails/issues/168 and tried to recreate the issue with a minimal installation of rails
> bundle exec rails console
Loading development environment (Rails 7.0.2.4)
irb(main):001:0> pp Stripe::Engine.helpers_paths
["/Users/tansengming/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/stripe-rails-2.3.3/app/helpers"]
=> ["/Users/tansengming/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/stripe-rails-2.3.3/app/helpers"]
irb(main):002:0> pp Stripe::JavascriptHelper
Stripe::JavascriptHelper
=> Stripe::JavascriptHelper
Unfortunately I cannot reproduce the NameError
you're seeing. Based on the output of pp Stripe::Engine.helpers_paths
it looks like the path is getting set up correctly without your patch.
So I'm stumped!
I appreciate that you got the gem working with the patch but I want to be cautious about adding code without figuring out. Based on feedback on https://github.com/tansengming/stripe-rails/issues/168 it still looks like some other gem is messing up ... something. Can you have a check to see which other gem is trying to load JavascriptHelper
?
@tansengming You have to set:
config.active_support.deprecation = :stderr
in your development.rb (or view the logs) to see it.
That's what its set to in test.rb so you should see it in test when running spring (you'll need to stop spring to see it).
@smtlaissezfaire thanks for the tip!
Unfortunately I was still not able to replicate it. Things I have tried:
bundle exec rails test:system
with a system test https://github.com/tansengming/stripe-rails-dummy/tree/2355912d8a256f294dd56b72fe208fb95cadc41cconfig.active_support.deprecation = :stderr
in development.rb
and rerunning the same sequence on https://github.com/tansengming/stripe-rails/pull/217#issuecomment-1116515314However even though I was not able to replicate this, I decided to merge https://github.com/tansengming/stripe-rails/pull/220 based on feedback from @chrisyuska and https://bill.harding.blog/2021/07/22/rails-6-1-deprecation-warning-initialization-autoloaded-the-constants-what-to-do-about-it/
FYI @yrashk the fix on https://github.com/tansengming/stripe-rails/pull/220 should fix this!
I've encountered the problem while upgrading to Rails 7 and found this solution in one of the issues (#168). Don't think this is the best solution but it got me past the problem. Any suggestions on how we can fix this better?