1

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

gem install thin

thin install

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

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

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

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

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

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 套接字或其他东西上进行配置?

4

1 回答 1

4

您应该添加gem thin到您的 Gemfile

PS:例如,参见https://github.com/macournoyer/thin/issues/115 。

于 2016-10-25T12:07:50.713 回答