0

私はdaemon_generatorプラグインに加えてRailsでデーモン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 "....

モデルのパスを別の方法で指定する必要がある可能性はありますか?私は通常、ActiveRecord :: Baseを必要とせずに、logger.infoを使用してロガーを呼び出します。もしそうなら、それを行う方法は?

この問題をデバッグする方法について何かアイデアはありますか?スタックトレースまたはより良いエラーメッセージを表示する方法はありますか?

4

1 に答える 1

0

Rails 環境に Daemon をロードすることで、この問題を解決しました。情報を入手したチュートリアルには含まれていませんでしたが、現在は機能しています:)

于 2009-05-12T21:58:48.037 に答える