ruby-on-railsnginxunicornmina

Unicorn/nginx /rails4 deployed via mina - 504 gateway timeout and errors in unicorn log


EDIT.... I have tried setting the whole thing up with Cap and puma and puma gives me the same error ans unicorn. Seems to be something to do with active_suppport....

Any help...

puma error log:

  pi@photo:~/rails/phototank/current$ bundle exec puma -C /home/pi/rails/phototank/shared/puma.rb
  Puma starting in single mode...
  * Version 2.16.0 (ruby 2.2.3-p173), codename: Midwinter Nights Trance
  * Min threads: 4, max threads: 16
  * Environment: production
  ! Unable to load application: LoadError: No such file to load -- Find
  /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require': No such file to load -- Find (LoadError)
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/releases/20160130233939/app/controllers/catalogs_controller.rb:1:in `<top (required)>'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:360:in `require_or_load'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:317:in `depend_on'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:233:in `require_dependency'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `each'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `block in eager_load!'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `each'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `eager_load!'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:346:in `eager_load!'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `each'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
    from /home/pi/rails/phototank/current/config/environment.rb:5:in `<top (required)>'
    from /home/pi/rails/phototank/current/config.ru:3:in `require'
    from /home/pi/rails/phototank/current/config.ru:3:in `block in <main>'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
    from /home/pi/rails/phototank/current/config.ru:in `new'
    from /home/pi/rails/phototank/current/config.ru:in `<main>'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/puma-2.16.0/lib/puma/configuration.rb:155:in `load_rackup'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/puma-2.16.0/lib/puma/configuration.rb:99:in `app'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/puma-2.16.0/lib/puma/runner.rb:114:in `load_and_bind'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/puma-2.16.0/lib/puma/single.rb:79:in `run'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/puma-2.16.0/lib/puma/cli.rb:214:in `run'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/gems/puma-2.16.0/bin/puma:10:in `<top (required)>'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/bin/puma:23:in `load'
    from /home/pi/rails/phototank/shared/bundle/ruby/2.2.0/bin/puma:23:in `<main>'

I can't get my production system running. I have followed thin excellent guide:https://www.ralfebert.de/tutorials/rails-deployment/ to get the whole thing running. I started out with a simple demo app and got that running. After that I did the same thing with my app. I have the whole deployment running, I can start unicorn and nginx without anything falling over...but no cigar...I get a 504 Gateway Time-out from nginx and a sh**load of errors in the nginx log. It seems like rails does not complain at all...since it's not really running.

I can run the same app om my development machine - so it shouldn't be my code. I suspect that it could be some dependency problem with gems - last info in the unicorn log is 'Refreshing Gem list' before it throws up

Here's some logs and setup:

Nginx log:

 [2016-01-30T13:40:13.321375 #1608] ERROR -- : reaped #<Process::Status: pid 1924 exit 1> worker=0
I, [2016-01-30T13:40:13.322633 #1608]  INFO -- : worker=0 spawning...
I, [2016-01-30T13:40:13.331328 #1931]  INFO -- : worker=0 spawned pid=1931
I, [2016-01-30T13:40:13.332517 #1931]  INFO -- : Refreshing Gem list
/home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require': No such file to load -- Find (LoadError)
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/releases/3/app/controllers/catalogs_controller.rb:1:in `<top (required)>'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:360:in `require_or_load'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:317:in `depend_on'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:233:in `require_dependency'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `each'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `block in eager_load!'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `each'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `eager_load!'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:346:in `eager_load!'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `each'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
    from /home/pi/rails/phototank/releases/3/config/environment.rb:5:in `<top (required)>'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from config.ru:4:in `block in <main>'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
    from config.ru:1:in `new'
    from config.ru:1:in `<main>'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn.rb:46:in `eval'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn.rb:46:in `block in builder'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:752:in `call'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:752:in `build_app!'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:617:in `init_worker_process'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:639:in `worker_loop'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:519:in `maintain_worker_count'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:283:in `join'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/bin/unicorn:126:in `<top (required)>'
    from /home/pi/.rvm/gems/ruby-2.2.3/bin/unicorn:23:in `load'
    from /home/pi/.rvm/gems/ruby-2.2.3/bin/unicorn:23:in `<main>'
    from /home/pi/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
    from /home/pi/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
E, [2016-01-30T13:40:17.174045 #1608] ERROR -- : reaped #<Process::Status: pid 1927 exit 1> worker=1
I, [2016-01-30T13:40:17.175791 #1608]  INFO -- : worker=1 spawning...
I, [2016-01-30T13:40:17.183616 #1935]  INFO -- : worker=1 spawned pid=1935
I, [2016-01-30T13:40:17.184766 #1935]  INFO -- : Refreshing Gem list
/home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require': No such file to load -- Find (LoadError)
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/releases/3/app/controllers/catalogs_controller.rb:1:in `<top (required)>'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:360:in `require_or_load'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:317:in `depend_on'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:233:in `require_dependency'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `each'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `block in eager_load!'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `each'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `eager_load!'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/engine.rb:346:in `eager_load!'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `each'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/pi/rails/phototank/releases/3/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
    from /home/pi/rails/phototank/releases/3/config/environment.rb:5:in `<top (required)>'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/pi/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from config.ru:4:in `block in <main>'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
    from config.ru:1:in `new'
    from config.ru:1:in `<main>'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn.rb:46:in `eval'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn.rb:46:in `block in builder'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:752:in `call'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:752:in `build_app!'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:617:in `init_worker_process'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:639:in `worker_loop'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:519:in `maintain_worker_count'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:283:in `join'
    from /home/pi/.rvm/gems/ruby-2.2.3/gems/unicorn-5.0.1/bin/unicorn:126:in `<top (required)>'
    from /home/pi/.rvm/gems/ruby-2.2.3/bin/unicorn:23:in `load'
    from /home/pi/.rvm/gems/ruby-2.2.3/bin/unicorn:23:in `<main>'
    from /home/pi/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
    from /home/pi/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
E, [2016-01-30T13:40:27.338467 #1608] ERROR -- : reaped #<Process::Status: pid 1931 exit 1> worker=0
I, [2016-01-30T13:40:27.339875 #1608]  INFO -- : worker=0 spawning...
I, [2016-01-30T13:40:27.347598 #1939]  INFO -- : worker=0 spawned pid=1939
I, [2016-01-30T13:40:27.348777 #1939]  INFO -- : Refreshing Gem list

Unicorn setup:

app_path = File.expand_path(File.join(File.dirname(__FILE__), '../../'))
#app_path = '/home/pi/rails/demo/releases/4'

listen '127.0.0.1:4000'
listen File.join(app_path, 'shared/unicorn.sock'), :backlog => 64

worker_processes 2

working_directory File.join(app_path, 'current')
pid File.join(app_path, 'shared/unicorn.pid')
stderr_path File.join(app_path, 'current/log/unicorn.log')
stdout_path File.join(app_path, 'current/log/unicorn.log')

nginx setup:

upstream phototank {
    server unix:/home/pi/rails/phototank/shared/unicorn.sock fail_timeout=0;
}

server {
    listen 80;
    server_name 192.168.2.103;

    root /home/pi/rails/phototank/current/public;
    index index.htm index.html;

    location / {
        try_files $uri/index.html $uri.html $uri @app;
    }

    location @app {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass http://phototank;
    }
}

server {
    listen 80;
    server_name 192.168.2.103;
    return 301 http://192.168.2.103$request_uri;
  }

Nginx log:

2016/01/30 13:19:59 [warn] 614#0: conflicting server name "192.168.2.103" on 0.0.0.0:80, ignored
2016/01/30 13:19:59 [warn] 781#0: conflicting server name "192.168.2.103" on 0.0.0.0:80, ignored
2016/01/30 13:47:36 [error] 785#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.2.70, server: 192.168.2.103, request: "GET /catalogs HTTP/1.1", upstream: "http://unix:/home/pi/rails/phototank/shared/unicorn.sock/catalogs", host: "192.168.2.103"

Solution

  • I will close this question although I have not found the answer...What I have found though is that this is the problem:

    Unable to load application: LoadError: No such file to load -- Find
    

    I have a controller where I do:

    require 'Find'
    
    class CatalogsController < ApplicationController
    ...
    

    When I remove the 'require Find' everything works fine. I leaves me with a new question about how to require modules (Find) in a controller???