better_spree_paypal_express
better_spree_paypal_express copied to clipboard
[3-0-stable] Error in production: uninitialized constant Spree::StoreController
The server is able to start just fine in development but when passing the variable RAILS_ENV=production
it doesn't start and shows:
better_spree_paypal_express-526d7f4f5bb9/app/controllers/spree/paypal_controller.rb:2:in `<module:Spree>': uninitialized constant Spree::StoreController (NameError)
Gemfile
gem 'rails', '4.2.1'
#...
gem 'spree_backend', '3.0.0'
gem 'spree_sample', '3.0.0'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
gem 'spree_ams', :github => 'hhff/spree_ams', :branch => '3-0-alpha'
gem 'spree_paypal_express', github: 'spree-contrib/better_spree_paypal_express', branch: '3-0-stable'
The only issue with a similar error was reported in 2013 (https://github.com/spree-contrib/better_spree_paypal_express/issues/7) and it was related to spree_gateway
.
Completely removing the gem (bundle clean --force
), did not solve the problem.
Note: in development the server starts just fine
I have a same problem. gem works fine on dev, but crashes on staging with same error as above.
https://github.com/spree-contrib/better_spree_paypal_express/blob/master/app/controllers/spree/paypal_controller.rb#L2 PaypalController inherits from StoreController which is defined in spree_frontend gem. I'm only using spree_backend. Maybe that's the issue? But why is it working on development then?
Any ideas? @givanse, maybe you found a solution?
@nowakov sure, this gem requires StoreController
, so also spree_frontend
.
this dependency should be in the gemspec to avoid confusion
it's working in development because it has lazy loading, i think
I ended up downgrading to 2.X.
I don't know why I didn't think about trying to also install the frontend gem, shouldn't be that way I think.