繁体   English   中英

Rails中的daemons gem问题

[英]Issue with daemons gem in Rails

除了daemon_generator插件,我还在Rails中使用daemons gem。 我在守护程序日志文件中得到以下输出:

 Logfile created on Sat May 09 20:10:35 -0700 2009 by /
-below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally ***
#<NameError: uninitialized constant SmsMessage>
-below you find all exception objects found in memory, some of them may have been thrown in your application, others may just be in memory because they are standard exceptions ***
#<NoMemoryError: failed to allocate memory>
#<SystemStackError: stack level too deep>
#<fatal: exception reentered>
#<MissingSourceFile: no such file to load -- ./config/global_constants.conf>
#<NameError: uninitialized constant SmsMessage>

我发现从此输出中很难理解。 它显示了不同的错误消息,我可以说不是不是./config/global_constants.conf问题,因为我没有在守护程序文件中调用它。 另外,我认为这不是内存问题,因为我的Mac具有2GB内存,并且运行的程序并不多。 至于SmsMessage我通常使用以下方式调用它:

scheduledMessagesParent = SmsMessage.valid.find(:all, :conditions => {:status => $SCHEDULED_MESSAGE})

可以在我网站的其他地方使用!! 我注意到记录器被称为

ActiveRecord::Base.logger.info "....

是否可能需要以其他方式指定模型的路径? 我通常使用logger.info调用记录器,而不需要ActiveRecord :: Base。 如果是这样,该怎么做?

任何想法如何去调试这个问题? 有没有办法显示堆栈跟踪或更好的错误消息?

我通过将Daemon加载到Rails环境中解决了这个问题。 我没有从中获取信息的教程,但现在可以使用它了:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM