ruby - Rails uninitialized constant in initializers -


i've taken on working rails 3 app offshore supplier , rails console failing @ line:

 settings.defaults[:processing_fee] = '0.99' 

in file config/initializers/settings.rb

i've compared file in git blame , matches. i've removed contents of file , runs doesn't line. reading on i've made filename , constant singular. following so post created file in config/application_settings.rb. constant not found in console. moving /initializers yielded on rails console

/users/sam/apps/tickat/config/initializers/application_settings.rb:1:in `<top (required)>': uninitialized constant settings (nameerror) 

from content:

 settings[:processing_fee] = '0.99' 

it appears environment not accepting constants here. first noticed pushing heroku , can replicate error in development in console. i've asked around , stuck. i'm sure it's goofed on, sam

it might forgot commit file in repo of application.

if case, , can't file author, need reverse engineer settings. make empty module:

module settings    def self.defaults      @defaults ||= {}   end  end 

and see how far can get, before more errors...

edit: can see in console how hash initalized:

irb(main):008:0> settings.defaults => {} irb(main):010:0> settings.defaults[:a] = 1 => 1 irb(main):011:0> settings.defaults => {:a=>1} 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -