Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法使用命令行来调试 ERB 文件?我想知道是否有任何方法可以让 rdebug 或 rdebug-ide 做到这一点。
如果你猴子修补你需要的方法,并且你包括一个调用debugger?您需要该方法的ruby-debug宝石debugger。
debugger
ruby-debug
可能有,但我一直在做相当于打印的工作。
放 YAML::dump(变量)
尝试类似的东西,STDERR.puts "Debug message"如果它是 Rails 或 Sinatra,它将出现在控制台窗口或日志中。
STDERR.puts "Debug message"