在过去的几天里,我一直在尝试解决困扰我的 active_record 问题。 railsforum 和 stackoverflow 已经完全干涸了。 这些帖子的长度和详细程度可能阻止了评论者,所以我再次尝试 - 简而言之。
在 Windows 下,陷阱行为在我的脚本中是正常的 - 直到我“需要'active_record'”,此时陷阱不再正常工作。 它们根本无法运行,这使我的数据库陷入混乱。
相关脚本通过活动记录与其他系统上的其他脚本进行交互。 当用户按下 control-c 或脚本因任何其他原因终止时,脚本在退出之前通知数据库其(脚本的)即将到来的厄运至关重要。 陷阱失效了,我被困住了。
有解决方法吗? 如果您对测试代码感兴趣,请参阅我的链接帖子。 只需几行即可重现该问题。
谢谢...
In the last couple of days, I've been trying to get a solution to an active_record issue that has been plaguing me. Posts on railsforum and stackoverflow have turned up completely dry. The length and level of detail in those posts may have dissuaded commentors, so I'm trying again - in brief.
Under windows, the trap behavior is normal in my scripts - until I "require 'active_record'," at which point traps no longer function properly. They fail to run at all and it is leaving my database in disarray.
The script in question interacts with other scripts on other systems through active record. When a user hits control-c or the script terminates for any other reason, it is critical that the script notify the database of its (the script's) impending doom before it exits. With trap out of commission, I'm stuck.
Is there a workaround? If you're interested in test code, see my linked posts. The problem can be reproduced in just a few lines.
Thanks...
发布评论
评论(1)
您是否考虑过在 Windows 平台上更新 Ruby? 我使用您的代码示例进行了一些测试,并得出以下结果:
Have you considered updating Ruby on the Windows platform? I made some tests with your code sample and came out with the following results: