if big error message in ruby or ruby on rails , don't understand it, how can decipher error message before posting stack overflow. there tools tips or techniques me bottom of error messages, , find code having problem?
error messages in ruby , ruby on rails quite clear if @ them closely. "stack trace" helpful. shows 3 things need solve problem:
- the paths of files involved
- the line numbers of files
the name of block error occurred in. example:
c:\users\krishnac\documents\netbeansprojects\githupbdcm\trunk>bundle exec rake rake aborted! incompatible library version - c:/ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.1.1.rc1-x86-mingw32/lib/bcrypt_ext.so c:/users/krishnac/documents/netbeansprojects/githupbdcm/trunk/config/application.rb:13:in <top (required)>' c:/users/krishnac/documents/netbeansprojects/githupbdcm/trunk/rakefile:5:in require' c:/users/krishnac/documents/netbeansprojects/githupbdcm/trunk/rakefile:5:in `<top (required)>' `(see full trace running task --trace)`
so have message
we can tell reading error can traced file
c:/users/krishnac/documents/netbeansprojects/githupbdcm/trunk/rakefile:5this doen't mean error occured in file, 1 of methods got called leading error is in file.
the
:5indicates fifth line error occurs.the next part of tells error occurs in block
require:rakefile:5:in 'require'
so see, reading error messages isn't bad. have through until find the file know relevant , find line number want , fix code.
Comments
Post a Comment