从其他位置保存后,Rails不会再写入development.log文件 [英] Rails doesn't write to development.log file anymore as soon as I save it from another location
问题描述
我正面临一个非常奇怪的问题.当我启动rails s
时,Rails会按预期记录log/development.log文件.
I'm facing a really strange problem. When I start rails s
, Rails logs as expected to log/development.log file.
一旦我在编辑器(例如Vi,TextMate)中将其打开并从那里保存它,Rails便不再对其进行写入!我必须重新启动服务器,然后它才能再次工作.
As soon as I open it in an editor (e.g. Vi, TextMate) and save it from there, Rails doesn't write to it anymore! I have to restart the server, and then it works again.
这真的很奇怪,似乎Vi/TextMate窃取"了写入文件的权利,只有重新启动Rails服务器才能重新获得该权利.
This is really strange, it seems like Vi/TextMate "steals" the right to write the file, and only a restart of the Rails server regains the right again.
任何人都知道这里发生了什么事?真烦人.只要我没有在development.log中点击保存",我也只能执行rake log:clear
,所以这是完全相同的奇怪行为……
Anybody has an idea what's happening here? This is really annoying. I'm also only able to do rake log:clear
as long as I didn't hit "save" for development.log, so it's exactly the same strange behavior...
我之前描述过类似的奇怪行为,并且我怀疑AckMate与它有关.遗憾的是,我没有得到任何回应,请参见
I described a similar strange behavior like this before, and I suspected AckMate to have something to do with it. Sadly, I didn't get any response, see here.
非常感谢您的帮助,这确实困扰了我.
Thanks a lot for help, this is really bugging me.
推荐答案
vim
将文件写入临时文件,然后重命名.
vim
writes your file to a temporary file and then renames it.
Rails进程不断写入旧的 fd .
The Rails process keeps writing to the old opened fd.
这篇关于从其他位置保存后,Rails不会再写入development.log文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!