0
votes

I'm trying to get my rails app up and running on my VPS (Ubuntu 14, Ruby 2.3, Rails 4, Capistrano 3, Nginx 1.4.6, Unicorn 5). Unfortunately I'm running into some issue with starting / restarting Unicorn

Capistrano gives me the following error:

DEBUG [e0b4d317] Command: /etc/init.d/unicorn_myapp restart

DEBUG [e0b4d317] Couldn't reload, starting 'cd /var/www/myapp/current; bundle exec unicorn -p 3000 -D -c /var/www/myapp/current/config/unicorn.rb -E production' instead

DEBUG [e0b4d317] master failed to start, check stderr log for details (Backtrace restricted to imported tasks)

cap aborted!

/shared/log/unicorn_error.log tells me:

E, [2016-03-09T18:02:28.795300 #32208] ERROR -- : adding listener failed addr=0.0.0.0:3000 (in use)

/var/www/myapp/shared/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/socket_helper.rb:149:in `bind': Address already in use - bind(2) for 0.0.0.0:3000 (Errno::EADDRINUSE)

I'm quite new to this. What could be the cause of this error?

1
Could you share your unicorn configuration?Maxim Filippov

1 Answers

1
votes

I had the similar issue, what helped was to put

listen 3000, reuseport: true

reuseport: true to my unicorn.rb