spree-guides icon indicating copy to clipboard operation
spree-guides copied to clipboard

uninitialized constant Spree::MyApp

Open christoph-buente opened this issue 11 years ago • 3 comments

NameError: uninitialized constant Spree::MyApp ~/Projects/shop/config/initializers/shop.rb:3:in <module:Spree>' ~/Projects/shop/config/initializers/shop.rb:2:in<top (required)>'

The example of the site wide preferences does not work. Where am i to define the Spree::MyApp::Config class?

module Spree Spree::MyApp::Config = Spree::MyApplicationConfiguration.new end

Spree::MyApp::Config[:theme] = "blue_theme" Spree::MyApp::Config[:show_spash_page] = true Spree::MyApp::Config[:number_of_articles] = 5

christoph-buente avatar Aug 30 '13 16:08 christoph-buente

MyApp is only an example. Could you please show us where in what guide says to do this?

radar avatar Sep 01 '13 23:09 radar

Of corse it is an example, but this class has be definded somewhere, even if i give it a different name. Where would i put it?

It is in the preference guide: https://github.com/spree/spree-guides/blob/master/content/developer/core/preferences.md Line 283

christoph-buente avatar Sep 02 '13 10:09 christoph-buente

It's most likely a bad example. What it should be is YourApplicationName, which matches the name inside config/application.rb.

radar avatar Sep 04 '13 03:09 radar