简体   繁体   English

无法启动瘦服务器Ruby Gem

[英]Cannot Start thin server Ruby Gem

I am trying to setup redmine on my server which is Redhat 6.2 I intend it to run with Nginx using thin ruby gem. 我正在尝试在我的服务器上设置redmine,这是Redhat 6.2我打算使用瘦红宝石宝石与Nginx一起运行。 I was following http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Nginx_to_run_Redmine I did following things 我正在关注http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Nginx_to_run_Redmine我做了以下事情

gem install thin

thin install

this gives me init script under /etc/rc.d/thin The YML file config is as follows: 这给了我/etc/rc.d/thin下的init脚本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

Now when I do /etc/rc.d/thin start it shows 现在当我做/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 ... 

but when I see pids under /app/redmine-root/tmp/pids there are no Pids. 但是当我在/app/redmine-root/tmp/pids下看到pids时,没有Pids。

therefore, I can't see any service running. 因此,我看不到任何服务正在运行。 This is issue number 1 这是第1号问题

Second thing I'd like to ask that, in Nginx conf as suggested by the above link the upstream block is like as follows: 第二件事我想问一下,在上面的链接中建议的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;
}

But the pid file is in /app/redmine-root/tmp/pids should this work? 但是pid文件在/app/redmine-root/tmp/pids应该可行吗?

Third, At the time of Install I marked the env as production 第三,在安装时我将env标记为production

RAILS_ENV=production rake db:migrate

But whenever I do thin config -C /etc/thin/redmine.yml it changes to development. 但每当我执行thin config -C /etc/thin/redmine.yml它都会改变为开发。

Please note that I have RVM also. 请注意我也有RVM。 And the user & owner of /app/redmine-root/ is apache . 并且/ app / redmine-root /的用户和所有者是apache My nginx runs with apache and I am trying to run thin also as apache. 我的nginx运行apache,我也试图运行瘦作为apache。

I have no background in Ruby. 我没有Ruby的背景。 Any help is much appreciated. 任何帮助深表感谢。

EDIT 编辑

After suggestions, I found this in log. 建议后,我在日志中找到了这个。

/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>'

is it because, I am trying to configure on UNIX socket or its something else?? 是因为,我试图在UNIX套接字或其他东西上配置?

You should add gem thin to your Gemfile 你应该在你的Gemfile中添加gem thin

PS: see at https://github.com/macournoyer/thin/issues/115 for example. PS:例如,请参阅https://github.com/macournoyer/thin/issues/115

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM