Closed mbhnyc closed 10 years ago
Hi @mbhnyc , Not sure about your ruby's version and patch level, I tried locally with MRI 2.0.0p353 with Rails 3.2.13/4/6. However I wasn't able to reproduce the error you have seen.
Have you seen this error before? What about other environments?
No I have not, and the issue does not occur in non-production environments!
Running 3.2.16 and the same Ruby.
Any ideas?
Hi @mbhnyc ,
I've tried all combinations of environments I have access to and still can't reproduce the issue.
I'm assuming your prod rails server doesn't have this issue, correct?
Is the error only bubble up in prod rails console?
Were you running bundle exec rails console
?
What about bundle exec rails runner
?
We're about to do a push to production with some unrelated changes (and ruby 2.1) and will try this again afterwards and report back!
No, this is ONLY occurring in Production! Ok, this is actually preventing rake from running my migrations, which is a bit troubling.
I'm in with the console if I run bundle exec rails console
, but bundle exec rake db:migrate
still fails.
Ok, I dropped back to the 1.2 gem version, which resolved the issue for now (at least so I could complete my deployment). I'll dive in a little and see if I can figure this out.
Just to clarify, the correct rails env is set, right?
e.g
RAILS_ENV=prod bundle exec ...
or bundle exec rails console prod
Well: RACK_ENV=production
and RAILS_ENV=production
but yes.
Hmm, not sure why I have both of those set.
I had the same problem in my Rails 4 app.
Adding BraintreeRails.eager_load!
to my braintree rails initializer file fixed it for me.
Hope that helps.
Hmm, it seems to be a random order problem of requiring the braintree-rails files.
Now it only happens occasionally in my rake tasks after adding BraintreeRails.eager_load!
to my braintree rails initializer file.
That's how I can reproduce the error, even without rails.
Works:
require 'braintree-rails'
BraintreeRails::CreditCard
BraintreeRails::Transaction
Doesn't work:
require 'braintree-rails'
BraintreeRails::Transaction
@lyang Can you confirm that?
@tmak, Yes, I can confirm. Working on a fix now.
Thank you very much for the feedback!
Yay! So glad a fix is in the works.
@mbhnyc, @tmak A fix has been checked into the master branch yesterday.
Would you mind try it out and let me know if it fixes the error?
Thanks!
@mbhnyc works for me, thanks!
Next time I do a deploy to production i'll update the gem and report back, sounds like we can close for now though. :+1:
Just tried to run console on an app with this gem deployed, and see the following exception:
Look familiar to anyone?