Ruby 守护进程无法启动
我正在使用 ruby daemons gem 为我的 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 插件)并尝试运行它时,甚至会发生这种情况。 有人知道如何解决这个问题吗?
I am using the ruby daemons gem to create a custom daemon for my rails project. 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. 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. Does anybody know how to fix this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我确实找到了这个问题的答案。 我需要 config/environment.rb 中的两个自定义文件。 我使用了相对路径名,因为守护进程是在 Rails 主目录中执行的,所以找不到这两个文件。 将它们设置为绝对路径后,问题就解决了。
OK, I actually found the answer to this problem. I require two custom files in the
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. after making them absolute path it fixed the problem.我只是花了 30 分钟试图解决在尝试让守护进程插件工作时出现的类似错误:
出于某种原因,它没有找到
active_support
lib,即使它已安装。 (也许是因为我的铁轨被冻住了)。就我而言,解决方案是在我的
中使用 active_support 的绝对路径
ctl 文件(例如 lib/daemons/mailer_ctl)。
我需要将第 5 行从: 更改
为
I just spent 30 minutes trying to solve a similar error when trying to get daemons plugin working:
For some reason, it wasn't finding
active_support
lib, even though it was installed. (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
ctl file (eg
lib/daemons/mailer_ctl
).I needed to change line 5 from:
to