2008-10-22 156 views
3

我正在使用ruby守護進程gem爲我的rails項目創建自定義守護進程。唯一的問題是,當我嘗試啓動守護進程ruby lib/daemons/test_ctl start它失敗並且不會啓動。日誌文件具有此輸出。Ruby守護進程不會啓動

# 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插件),並嘗試運行它有時甚至會出現。有誰知道如何解決這個問題?

回答

3

好的,我真的找到了這個問題的答案。我需要config/environment.rb中的兩個自定義文件。我使用相對路徑名稱,並且因爲守護進程在rails主目錄中執行,所以無法找到這兩個文件。在使它們成爲絕對路徑後,它解決了問題。

+0

我能得到它由Daemons.run線前加入這一行的工作: `$ < duma 2011-06-27 19:09:58

1

我只花了30分鐘試圖解決一個類似的錯誤試圖讓守護進程插件工作時:

LoadError: no such file to load -- active_support 

出於某種原因,人們沒有找到active_support lib下,即使它被安裝。 (也許是因爲我有冰凍的鐵軌)。
在我的情況下,解決方案是在我的
ctl文件(例如lib/daemons/mailer_ctl)中使用active_support的絕對路徑。

我需要從改變線路5:

require 'active_support' 

require './vendor/rails/activesupport/lib/active_support.rb'