ruby on rails - Why is Unicorn looking for rackup file (config.ru) even though I am specifying a config? -


i ssh'd ubuntu 14.04 server instance, trying bootstrap unicorn server rails 4.2 app.

cd /home/sh0/app/current/api bundle exec unicorn -e production -c /home/sh0/app/current/api/config/unicorn.rb 

but fails!

/usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:657:in `parse_rackup_file': rackup file (config.ru) not readable (argumenterror)         /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:77:in `reload'         /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:68:in `initialize'         /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:100:in `new'         /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:100:in `initialize'         /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/bin/unicorn:126:in `new'         /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/bin/unicorn:126:in `<top (required)>'         /home/sh0/app/releases/20150514055558/api/bin/unicorn:16:in `load'         /home/sh0/app/releases/20150514055558/api/bin/unicorn:16:in `<main>' 

so, why doesn't find dang config.ru file? it's right there, local development purposes- if fire unicorn without flags, finds fine, if in development environment.

bundle exec unicorn 

normal (development, not production need in environment) bootstrap ok:

i, [2015-05-14t06:00:44.081575 #5859]  info -- : listening on addr=0.0.0.0:8080 fd=9 i, [2015-05-14t06:00:44.081818 #5859]  info -- : worker=0 spawning... i, [2015-05-14t06:00:44.082427 #5859]  info -- : master process ready i, [2015-05-14t06:00:44.083162 #5862]  info -- : worker=0 spawned pid=5862 i, [2015-05-14t06:00:44.083380 #5862]  info -- : refreshing gem list i, [2015-05-14t06:00:45.399105 #5862]  info -- : worker=0 ready 

okay, try doing in between 2 attempts.

on remote server:

cd /home/sh0/app/current/api unicorn -c config/unicorn.rb  

notice working_directory in error message:

/usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:539:in `working_directory': config_file=config/unicorn.rb not accessible in working_directory=/home/sh0/app/current (argumenterror) 

i have mis-configured config/unicorn.rb.

my rails project not @ base of repository, , therefore needed update working_directory specified default in file.

the new configuration is:

working_directory "/home/sh0/app/current/api" 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -