简体   繁体   English

Ruby Daeons将无法启动

[英]Ruby Daemons will not start

I am using the ruby daemons gem to create a custom daemon for my rails project. 我正在使用ruby守护进程gem为我的rails项目创建一个自定义守护进程。 The only problem is that when I try to start the daemons ruby lib/daemons/test_ctl start that it fails and will not start. 唯一的问题是,当我尝试启动守护进程时, ruby lib/daemons/test_ctl start它失败并且无法启动。 The log file has this output. 日志文件具有此输出。

# 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>  

It even happens when I generate a daemon (from the rails plugin) and try to run it. 它甚至发生在我生成一个守护进程(来自rails插件)并尝试运行它。 Does anybody know how to fix this problem? 有人知道如何解决这个问题吗?

OK, I actually found the answer to this problem. 好的,我实际上找到了这个问题的答案。 I require two custom files in the config/environment.rb . 我在config/environment.rb需要两个自定义文件。 I used relative path names and because the daemons are executed in the rails main directory it could not find these two files. 我使用了相对路径名,因为守护进程在rails主目录中执行,所以无法找到这两个文件。 after making them absolute path it fixed the problem. 在使它们成为绝对路径后,它解决了问题。

I just spent 30 minutes trying to solve a similar error when trying to get daemons plugin working: 我试图让daemons插件工作时花了30分钟试图解决类似的错误:

LoadError: no such file to load -- active_support

For some reason, it wasn't finding active_support lib, even though it was installed. 出于某种原因,它没有找到active_support lib,即使它已安装。 (Perhaps due to me having frozen rails). (也许是因为我有冰冻的铁轨)。
In my case, the solution to this was to use the absolute path for active_support in my 在我的例子中,解决方案是在我的中使用active_support的绝对路径
ctl file (eg lib/daemons/mailer_ctl ). ctl文件(例如lib/daemons/mailer_ctl )。

I needed to change line 5 from: 我需要改变第5行:

   require 'active_support'

to

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

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

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