本文介绍了Rails:除非我停止服务器并再次启动,否则Ruby调试器会显示旧代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用ruby-debug,当我发出list
命令时,它显示了旧代码.因此,如果我更新模型中debugger
命令周围的代码(尤其是之前),它仍会显示旧代码.
Using ruby-debug, when I issue a list
command, it shows old code. So if I update the code surrounding (especially before) the debugger
command in the model it still shows the old code.
我发现刷新"此代码的唯一方法是停止服务器并再次运行它.
The only way I have found to 'refresh' this code is by stopping the server and running it again.
有更好的方法吗?
谢谢
乔什
推荐答案
您不能只是执行reload
吗?您还可以设置自动重新加载的标志,但是我自己从来没有尝试过(我倾向于立即使用Netbeans)
Can't you just do a reload
? You can also set a flag for auto-reloading but never tried it myself (I tend to use Netbeans now)
这篇关于Rails:除非我停止服务器并再次启动,否则Ruby调试器会显示旧代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!