Search code examples
ruby-on-railscapistranothin

"bundle exec thin start -C config/thin.yml" does not start thin


in attempt to deploy rails app to server I faced problem that 'thin' does't stars when I try do star it with cap production deploy:start. What is realy strange, than it hasn't any errors. After this I try do it on deplyment server

env RAILS_ENV=production bundle exec thin start -C config/thin.yml

Starting server on /home/deployer/app/current/tmp/sockets/thin.0.sock ... 
Starting server on /home/deployer/app/current/tmp/sockets/thin.1.sock ... 

ls /home/deployer/app/current/tmp/sockets/

ps -aux | grep thin
root     16769  0.0  0.1  15468   908 pts/0    S    11:34   0:00 grep --color=auto thin

thin.yml

chdir: /home/deployer/app/current
environment: production
timeout: 30
log: /home/deployer/app/current/log/thin.log
pid: /home/deployer/app/current/tmp/pids/thin.pid
socket: /home/deployer/app/current/tmp/sockets/thin.sock
max_conns: 1024
max_persistent_conns: 10
require: []
wait: 30
servers: 2
daemonize: true 

What is gone wrong?

In production.log only migrations

bundle exec thin start -C config/thin.yml &

returns

Starting server on /home/deployer/app/current/tmp/sockets/thin.0.sock ... 
Starting server on /home/deployer/app/current/tmp/sockets/thin.1.sock ... 
'bundle exec thin start -C confi…' has ended

Answer Okey, answer was log/thin.0.log there are some errors in code


Solution

  • You need to demonize thin for running it in production by adding &. Try this:

    RAILS_ENV=production bundle exec thin start -C config/thin.yml &