Unicorn启动配置失败

时间:2014-04-22 00:10:20

标签: ruby-on-rails ruby unicorn

Unicorn通过命令成功启动:

bundle exec unicorn_rails -E development

无法使用config.rb

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

E, [2014-04-22T11:04:49.358626 #8207] ERROR -- : reaped #<Process::Status: pid 8465 exit 1> worker=0
I, [2014-04-22T11:04:49.359031 #8207]  INFO -- : worker=0 spawning...
I, [2014-04-22T11:04:49.361032 #8468]  INFO -- : worker=0 spawned pid=8468
I, [2014-04-22T11:04:49.361354 #8468]  INFO -- : Refreshing Gem list
E, [2014-04-22T11:04:49.361911 #8468] ERROR -- : undefined method `worker_processes' for main:Object (NoMethodError)
/home/den/buybets/config/unicorn.rb:1:in `<top (required)>'
/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 `<top (required)>'
/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 `<main>'
/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 `<main>'

配置/ unicorn.rb

worker_processes 2

working_directory("/home/deployer/blog/current")

stderr_path "/home/deployer/blog/log/unicorn.stderr.log"
stdout_path "/home/deployer/blog/log/unicorn.stdout.log"

Rails 4.1.0

ruby​​ 2.1.0p0(2013-12-25修订版44422)[x86_64-linux]

独角兽v4.8.2

我的Google搜索没有产生任何结果。

2 个答案:

答案 0 :(得分:3)

您忘记了-c

试试这个:

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

答案 1 :(得分:0)

首先你使用bundle exec unicorn_rails -E development,一切正常 然后你使用bundle exec unicorn ./config/unicorn.rb -E development并没有任何作用?

问题非常有趣,您使用unicorn代替unicorn_rails