3

私はrubydaemonsgemを使用して、railsプロジェクトのカスタムデーモンを作成しています。唯一の問題は、デーモンruby lib/daemons/test_ctl startを起動しようとすると失敗し、起動しないことです。ログファイルにはこの出力があります。

# Logfile created on Wed Oct 22 16:14:23 +0000 2008 by /  
*** below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally \*\*\*  
# MissingSourceFile: no such file to load -- utf8proc_native  
*** 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>  
# LoadError: no such file to load -- daemons>  
# LoadError: no such file to load -- active_support>  
# MissingSourceFile: no such file to load -- lib/string>  
# MissingSourceFile: no such file to load -- utf8proc_native>  

これは、(railsプラグインから)デーモンを生成して実行しようとしたときにも発生します。誰かがこの問題を解決する方法を知っていますか?

4

2 に答える 2

3

OK、実際にこの問題の答えを見つけました。に 2 つのカスタム ファイルが必要ですconfig/environment.rb。相対パス名を使用しましたが、デーモンは Rails のメイン ディレクトリで実行されるため、これら 2 つのファイルを見つけることができませんでした。それらを絶対パスにした後、問題は修正されました。

于 2008-10-22T09:17:17.730 に答える
1

デーモンプラグインを機能させようとしたときに、同様のエラーを解決するために30分を費やしました:

LoadError: no such file to load -- active_support

active_supportlibがインストールされているにもかかわらず、何らかの理由でlibが見つかりませんでした。(おそらく、私がレールを凍らせたことが原因です)。 私の場合、これに対する解決策は、 ctl ファイル
で active_support の絶対パスを使用することでした(例: )。
lib/daemons/mailer_ctl

5 行目を次のように変更する必要がありました。

   require 'active_support'

 require './vendor/rails/activesupport/lib/active_support.rb'
于 2008-12-14T06:48:29.397 に答える