无法启动瘦服务器Ruby Gem

时间:2013-09-13 04:51:37

标签: ruby redmine thin

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

gem install thin

thin install

这给了我/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下看到pid时,没有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套接字或其他东西上配置?

1 个答案:

答案 0 :(得分:4)

您应该将gem thin添加到您的Gemfile

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