gpt4 book ai didi

python - Get Thin (bundle exec Thin) 与 Circus 一起使用

转载 作者:行者123 更新时间:2023-12-01 05:12:00 27 4
gpt4 key购买 nike

我使用 Circus 作为 Rails 项目的主管,但在让它与我选择的 Ruby 服务器 Thin 一起工作时遇到了一些奇怪的问题。这是我的circus.ini:

[circus]
check_delay = 5

[socket:server]
host = 127.0.0.1
port = 8080

[watcher:server]
working_dir = /home/myuser/myproject/myproject
cmd = bundle exec thin start -C /home/myuser/myproject/etc/thin.yml -S $(circus.sockets.server)
use_sockets = True
numprocesses = 3

stdout_stream.class = FileStream
stdout_stream.filename = /home/myuser/myproject/log/circus_server.log
stdout_stream.time_format = %Y-%m-%d %H:%M:%S

[env:server]
RAILS_ENV=production

但是当我启动 circus 时(sudo service circus start),这是我在日志中找到的内容:

$ cat log/circus.log 2014-06-03 10:42:27 circus[30987] [INFO] Starting master on pid 30987 2014-06-03 10:42:27 circus[30987] [INFO] sockets started 2014-06-03 10:42:27 circus[30987] [WARNING] error in 'server': [Errno 2] No such file or directory 2014-06-03 10:42:27 circus[30987] [WARNING] error in 'server': [Errno 2] No such file or directory 2014-06-03 10:42:27 circus[30987] [WARNING] error in 'server': [Errno 2] No such file or directory 2014-06-03 10:42:27 circus[30987] [WARNING] error in 'server': [Errno 2] No such file or directory 2014-06-03 10:42:27 circus[30987] [WARNING] error in 'server': [Errno 2] No such file or directory 2014-06-03 10:42:27 circus[30987] [INFO] server stopped 2014-06-03 10:42:27 circus[30987] [INFO] Arbiter now waiting for commands

事实上,我将 cmd 更改为任何其他命令,例如 python -m SimpleHTTPServer 并且它有效。这里发生了什么?

编辑:这是 what happens当我使用 --log-level debug 运行 circusd 时...无论 circus.ini 中的 copy_env = True 如何,我仍然得到相同的输出。

最佳答案

您收到的[Errno 2] No such file or directory可能意味着 Circus 没有找到bundle。您可以尝试将 RVM bin 目录添加到您的路径中,如下所示:

[env:server]
PATH=$PATH:/path/to/your/rvm/bin

您最可能需要的文件夹是“wrappers”,因为它同时包含 ruby​​ 和 gems 脚本,因此请尝试一下:

PATH=$PATH:/path/to/your/.rvm/wrappers/<your ruby version>

关于python - Get Thin (bundle exec Thin) 与 Circus 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24018306/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com