Search code examples
ruby-on-railsnginxcapistranounicorn

/usr/bin/env ruby no such file digitalocean unicorn nginx


I removed RVM from the server and reinstalled it. But since reinstalling RVM I'm having this error. I'**m using Capistrano for the deployment.Whenever I restart the Unicorn I'm getting this error

E, [2017-01-31T05:36:33.653206 #7453] ERROR -- : reaped #<Process::Status: pid 15309 exit 127> exec()-ed
I, [2017-01-31T05:39:42.348526 #7453]  INFO -- : reloading config_file=/home/current/config/unicorn.rb
E, [2017-01-31T05:39:42.403642 #7453] ERROR -- : error reloading config_file=/home/current/config/unicorn.rb: No such file or director$
E, [2017-01-31T05:39:42.403843 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/util.rb:71:in `initialize'
E, [2017-01-31T05:39:42.403889 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/util.rb:71:in `open'
E, [2017-01-31T05:39:42.403957 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/util.rb:71:in `block in reopen_$
E, [2017-01-31T05:39:42.404012 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/util.rb:40:in `each'
E, [2017-01-31T05:39:42.404089 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/util.rb:40:in `reopen_logs'
E, [2017-01-31T05:39:42.404169 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:731:in `load_con$
E, [2017-01-31T05:39:42.404237 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:314:in `join'
E, [2017-01-31T05:39:42.404308 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/bin/unicorn:126:in `<top (required)>'
E, [2017-01-31T05:39:42.404390 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `load'
E, [2017-01-31T05:39:42.404452 #7453] ERROR -- : /home/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `<main>'
I, [2017-01-31T05:39:42.505115 #7453]  INFO -- : reaped #<Process::Status: pid 15209 exit 0> worker=1
I, [2017-01-31T05:39:42.511521 #7453]  INFO -- : reaped #<Process::Status: pid 15206 exit 0> worker=0
I, [2017-01-31T05:39:42.533619 #17166]  INFO -- : worker=1 ready
I, [2017-01-31T05:39:42.533622 #17169]  INFO -- : worker=0 ready
I, [2017-01-31T05:39:43.618823 #17269]  INFO -- : executing ["/home/shared/bundle/ruby/2.3.0/bin/unicorn", "-c", "/home/current/config/unicorn$
I, [2017-01-31T05:39:43.619090 #17269]  INFO -- : forked child re-executing...
/usr/bin/env: ruby: No such file or directory
E, [2017-01-31T05:39:43.625102 #7453] ERROR -- : reaped #<Process::Status: pid 17269 exit 127> exec()-ed**

Solution

  • I would completely stop unicorn and start it again. You can do a ps -ef | grep unicorn to make sure it's all gone. If all you're doing is asking the master to restart the children, they won't notice any updates to your init script.