하루에 한두 번 정도 잠그는 랙 앱 (here)을 작성했으며 앱을 디버깅해야합니다.내 Rack 앱이 실행되는 동안 어떻게 디버그 할 수 있습니까?
그래서 다음과 같이 시도했습니다 : http://robots.thoughtbot.com/using-gdb-to-inspect-a-running-ruby-process. 나는 간단한 테스트 스크립트에 대해 디버깅을 시도 :
class MyTest
def initialize
@a ||= 1
end
def something
@a += 1
puts @a
end
end
test = MyTest.new
while true do
sleep 3
test.something
end
그러나, 나는이 얻을 :
(gdb) redirect_stdout
No symbol "rb_eval_string" in current context.
(gdb) ruby_eval('Kernel.caller')
No symbol "rb_p" in current context.
내가 다른 무엇을해야하는지 어떤 생각? 또는 디버깅 할 수있는 다른 방법이 있습니까? "puts"문을 사용하지 않고 로그에 쓰는 것을 피하고 싶습니다. 이미 시도 했으므로 매우 적합합니다.