Am 04.01.2010 um 21:09 schrieb Quee WM:

> I have the following app_config.yml in rails_root/config/
> 
> development: &non_production_settings
>  :bit_ly:
>    :login: "xxxxxxxxx"
>    :api_key: "xxxxxxxxx"
>    :history: "0"
> 
> test:
>  <<: *non_production_settings
> 
> production:
>  :bit_ly:APP_CONFIG = YAML.load(File.read(RAILS_ROOT +
> "/config/app_config.yml"))[RAILS_ENV]
>    :login: "xxxxxxxxx"
>    :api_key: "xxxxxxxxx"
>    :history: "1"
> 
> i am loading this config file with following
> 
> APP_CONFIG = YAML.load(File.read(RAILS_ROOT +
> "/config/app_config.yml"))[RAILS_ENV]
> 
> in my lib/somefolder/comeclass i am calling
> 
> APP_CONFIG[:bit_ly][:history] which results in an error 'const-missing'
> 
> what can be the reason?

I think yaml keys need to be strings, not symbols, i.e. that would read:

development:
  bit_ly:
    login: something
    api_key: secret
    history: 0

Felix

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to