ruby on rails - How do I debug an error in a gem? -
i'm getting error paperclip gem.
nomethoderror (you have nil object when didn't expect it! might have expected instance of array. error occurred while evaluating nil.size): paperclip (2.3.8) lib/paperclip/attachment.rb:104:in `assign'
how can debug this, seeing though it's in gem? if code place few puts
see what's going on, can't here. i'm using rails 3.0.1
here's best shot.
- open 1 of controllers , add
debugger
line it. need debugger kick in set breakpoint - next
run rails --debug
- navigate page / controller breakpoint
- the debugger console appear.
- run
gem.find_files("attachment.rb")
<- i'll call $gem_root path returns - run
list $gem_root/lib/paperclip/attachment.rb:104
- show code around area error occurred. - run
b $gem_root/lib/paperclip/attachment.rb:$line
- replace $line candidate breakpoint. - run
cont
- hit page / action causes error, , debug console should open @ break point.
i think there must way path gem file programmatically, have no idea how :(
Comments
Post a Comment