簡體   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