Skip to content
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

[3-0-stable] Error in production: uninitialized constant Spree::StoreController #175

Open
givanse opened this issue Jul 30, 2015 · 5 comments

Comments

@givanse
Copy link

givanse commented Jul 30, 2015

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'
@givanse
Copy link
Author

givanse commented Jul 30, 2015

The only issue with a similar error was reported in 2013 (#7) and it was related to spree_gateway.

Completely removing the gem (bundle clean --force), did not solve the problem.

@givanse givanse changed the title Error in production: uninitialized constant Spree::StoreController [3-0-stable] Error in production: uninitialized constant Spree::StoreController Jul 30, 2015
@givanse
Copy link
Author

givanse commented Jul 30, 2015

Note: in development the server starts just fine

@nowakov
Copy link

nowakov commented Oct 22, 2015

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?

@alepore
Copy link
Member

alepore commented Oct 22, 2015

@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

@givanse
Copy link
Author

givanse commented Oct 25, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants