D
D
Dendeyk2014-04-22 03:52:04
Ruby on Rails
Dendeyk, 2014-04-22 03:52:04

How to fix Unicorn startup issue with config?

Unicorn starts successfully with command
bundle exec unicorn -E development
When trying to start Unicorn with config file with command

bundle exec unicorn -E development  ./config/unicorn.rb

The screen displays a lot of errors like:
, [2014-04-22T11:49:55.771104 #11555] ERROR -- : reaped # worker=0
I, [2014-04-22T11:49:55.771344 #11555] INFO -- : worker =0 spawning...
I, [2014-04-22T11:49:55.772713 #11829] INFO -- : worker=0 spawned pid=11829
I, [2014-04-22T11:49:55.773356 #11829] INFO -- : Refreshing Gem list
E, [2014-04-22T11:49:55.774927 #11829] ERROR -- : undefined method `worker_processes' for main:Object (NoMethodError)
/home/den/uni/config/unicorn.rb:1: in `'
/home/den/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/lib/unicorn.rb:50:in `require'
/home/den/.rvm/gems/ruby -2.1.0/gems/unicorn-4.8.2/lib/unicorn.rb:50:in `block in builder'
/home/den/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:760:in `call'
/home/den/.rvm/gems/ruby- 2.1.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:760:in `build_app!'
/home/den/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:624:in `init_worker_process'
/home/den/.rvm/gems/ruby- 2.1.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:647:in `worker_loop'
/home/den/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/ lib/unicorn/http_server.rb:521:in `spawn_missing_workers'
/home/den/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:532:in ` maintain_worker_count'
/home/den/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:290:in `join'
/home/den/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/bin/unicorn:126:in `'
/home/den/.rvm/gems/ruby-2.1.0/bin /unicorn:23:in `load'
/home/den/.rvm/gems/ruby-2.1.0/bin/unicorn:23:in `'
/home/den/.rvm/gems/ruby-2.1.0/ bin/ruby_executable_hooks:15:in `eval'
/home/den/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `'
config/unicorn.rb
worker_processes 4
Rails 4.1 , Ruby 2.1, Unicron 4.8.2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rsludge, 2014-04-22
@Dendeyk

bundle exec unicorn -E development -c ./config/unicorn.rb

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question