How do I better debug this message? The trace shows 3 lines from one of my files - application.rb:
18 module CustomApp
19 class Application < Rails::Application
...
49 # Enable the asset pipeline
Is there a way to find out exactly which file is throwing this error?
The last trace:
/home/user/.rvm/gems/ruby-1.9.3-p0/gems/figaro-0.2.0/lib/figaro/railtie.rb:8:in `update'
I feel like I've hit a brick wall..for that reason, although I'm anxious to fix this error, I'm more anxious to find out how to better debug these messages? Surely something like "Can't convert Hash into String in somefile.rb:112" would be easily handled?
config/application.yml
file. Did you alter that in any way or is it not formatted correctly? (I'm making this guess based on reading the line of code reported in your 'last trace. - Charles Caldwell 2012-04-05 19:42
To learn about ruby-debug: http://bashdb.sourceforge.net/ruby-debug.html
To learn about debugging Rails: http://guides.rubyonrails.org/debugging_rails_applications.html
The error is coming from this file:
lib/figaro/railtie.rb line 8
The code block in that file:
path = Rails.root.join("config/application.yml")
ENV.update(YAML.load(File.read(path)) || {}) if File.exist?(path)
One way to troubleshoot is to use ruby-debug:
gem install ruby-debug
And edit that file to make it show better errors:
path = Rails.root.join("config/application.yml")
if File.exist?(path)
debugger
f = File.read(path)
y = YAML.load(f)
ENV.update(y || {})
end