I have noticed that in apps like Hieraki and WEIRD, that the config
yaml files are named liked "config.yml.example" or
"config.yml.sample". I tried that and I get a file not find error upon
start up of my webbrick. How are these filenames working in these
other apps?
I ask because I am having no luck getting my config yaml to work. Here
is what I''ve got:
----------------------------------
In Enviroments.rb -->
require ''yaml''
begin
CONFIG = YAML::load(File.open("#{RAILS_ROOT}/config/config.yml"))
rescue ArgumentError
RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
RAILS_DEFAULT_LOGGER.level = Logger::WARN
RAILS_DEFAULT_LOGGER.warn("Rails Error: Syntax error in
/config/*.yml")
end
My root/config/config.yml file :
amazonid: "wordshere-20"
amazonURL: "http://www.amazon.com/exec/obidos/ASIN/"
amazonToken: D32UFZMPMXXXXX
And a sample view which references the config file:
<h1>Your amazon id is <%= CONFIG[''amazonid'']
%></h1>
But nothing ever shows up. If is try to reference the amazonToken to
access some webservices, then I get an error message saying the token
is nil.
What am I missing?
Thanks,
Steve