gpt4 book ai didi

ruby - 无法启动瘦服务器 Ruby Gem

转载 作者:太空宇宙 更新时间:2023-11-03 17:53:43 25 4
gpt4 key购买 nike

我正在尝试在我的 Redhat 6.2 服务器上安装 redmine我打算使用薄 ruby​​ gem 与 Nginx 一起运行。我在关注 http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Nginx_to_run_Redmine我做了以下事情

gem 安装瘦

精简安装

这给了我 /etc/rc.d/thin 下的初始化脚本 YML 文件配置如下:

---
chdir: /app/redmine-root/
environment: development
address: 0.0.0.0
port: 5000
timeout: 30
log: log/thin.log
pid: tmp/pids/thin.pid
max_conns: 1024
max_persistent_conns: 100
require: []
wait: 30
servers: 4
daemonize: true

现在,当我执行 /etc/rc.d/thin start 时,它会显示

Starting server on 0.0.0.0:5000 ... 
Starting server on 0.0.0.0:5001 ...
Starting server on 0.0.0.0:5002 ...
Starting server on 0.0.0.0:5003 ...

但是当我在 /app/redmine-root/tmp/pids 下看到 pids 时,没有 Pids。

因此,我看不到任何服务正在运行。这是第 1 期

我想问的第二件事是,在上面链接建议的 Nginx conf 中,上游 block 如下所示:

upstream thin_cluster {
server unix:/tmp/thin.0.sock;
server unix:/tmp/thin.1.sock;
server unix:/tmp/thin.2.sock;
server unix:/tmp/thin.3.sock;
}

但是 pid 文件在 /app/redmine-root/tmp/pids 中,这应该有效吗?

第三,在安装时我将环境标记为production

RAILS_ENV=production rake db:migrate

但每当我执行 thin config -C/etc/thin/redmine.yml 时,它都会更改为开发。

请注意,我也有 RVM。/app/redmine-root/的用户和所有者是 apache。我的 nginx 与 apache 一起运行,我也试图以 apache 的形式运行。

我没有 Ruby 背景。非常感谢任何帮助。

编辑

根据建议,我在日志中找到了这个。

/usr/local/lib/ruby/gems/2.0.0/gems/thin-1.5.1/lib/thin/backends/tcp_server.rb:16:in `connect': cannot load such file -- thin/connection (LoadError)
from /usr/local/lib/ruby/gems/2.0.0/gems/thin-1.5.1/lib/thin/backends/base.rb:55:in `block in start'
from /usr/local/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `call'
from /usr/local/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
from /usr/local/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
from /usr/local/lib/ruby/gems/2.0.0/gems/thin-1.5.1/lib/thin/backends/base.rb:63:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/thin-1.5.1/lib/thin/server.rb:159:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/thin-1.5.1/lib/thin/controllers/controller.rb:86:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
from /usr/local/lib/ruby/gems/2.0.0/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
from /usr/local/lib/ruby/gems/2.0.0/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
from /usr/local/bin/thin:23:in `load'
from /usr/local/bin/thin:23:in `<main>'

是不是因为,我正在尝试在 UNIX 套接字或其他东西上进行配置??

最佳答案

你应该添加 gem thin 到你的 Gemfile

附注:参见 https://github.com/macournoyer/thin/issues/115例如。

关于ruby - 无法启动瘦服务器 Ruby Gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18778544/

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