Единорог Crash Loop - PullRequest
       22

Единорог Crash Loop

2 голосов
/ 16 июля 2011

Я пытаюсь настроить Unicorn с Nginx на моем компьютере с Ubuntu 11.04.Я скомпилировал Ruby из исходного кода (ранее пробовал RVM, но у него были многочисленные проблемы с этим), и теперь после установки Unicorn (а также rails 3.1.0 RC4) возникает странная проблема, когда он вылетает, а затем пытается запустить часть, которая вылетаетнесколько раз или, по крайней мере, так оно и выглядит.

Вывод

root@server-pc:/usr/local/blog# unicorn_rails
I, [2011-07-15T13:14:50.577149 #23269]  INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2011-07-15T13:14:50.577677 #23269]  INFO -- : worker=0 spawning...
I, [2011-07-15T13:14:50.579412 #23269]  INFO -- : master process ready
I, [2011-07-15T13:14:50.581087 #23271]  INFO -- : worker=0 spawned pid=23271
I, [2011-07-15T13:14:50.581599 #23271]  INFO -- : Refreshing Gem list
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rack 1.3.1, but your Gemfile requires rack 1.3.0. Consider using bundle exec. (Gem::LoadError)
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:17:in `setup'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler.rb:107:in `setup'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/setup.rb:7:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:33:in `require'
        from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from /usr/local/blog/config/boot.rb:6:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from /usr/local/blog/config/application.rb:1:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from /usr/local/blog/config/environment.rb:2:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from config.ru:4:in `block in <main>'
        from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.1/lib/rack/builder.rb:51:in `instance_eval'
        from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.1/lib/rack/builder.rb:51:in `initialize'
        from config.ru:1:in `new'
        from config.ru:1:in `<main>'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn.rb:44:in `eval'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn.rb:44:in `block in builder'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/bin/unicorn_rails:139:in `call'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/bin/unicorn_rails:139:in `block in rails_builder'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:673:in `call'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:673:in `build_app!'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:549:in `init_worker_process'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:567:in `worker_loop'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:475:in `spawn_missing_workers'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:135:in `start'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/bin/unicorn_rails:209:in `<top (required)>'
        from /usr/local/bin/unicorn_rails:19:in `load'
        from /usr/local/bin/unicorn_rails:19:in `<main>'
E, [2011-07-15T13:14:52.259536 #23269] ERROR -- : reaped #<Process::Status: pid 23271 exit 1> worker=0
I, [2011-07-15T13:14:52.259859 #23269]  INFO -- : worker=0 spawning...
I, [2011-07-15T13:14:52.263092 #23274]  INFO -- : worker=0 spawned pid=23274
I, [2011-07-15T13:14:52.263665 #23274]  INFO -- : Refreshing Gem list
^C/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rack 1.3.1, but your Gemfile requires rack 1.3.0. Consider using bundle exec. (Gem::LoadError)
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:17:in `setup'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler.rb:107:in `setup'
        from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/setup.rb:7:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:33:in `require'
        from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from /usr/local/blog/config/boot.rb:6:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from /usr/local/blog/config/application.rb:1:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from /usr/local/blog/config/environment.rb:2:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from config.ru:4:in `block in <main>'
        from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.1/lib/rack/builder.rb:51:in `instance_eval'
        from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.1/lib/rack/builder.rb:51:in `initialize'
        from config.ru:1:in `new'
        from config.ru:1:in `<main>'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn.rb:44:in `eval'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn.rb:44:in `block in builder'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/bin/unicorn_rails:139:in `call'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/bin/unicorn_rails:139:in `block in rails_builder'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:673:in `call'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:673:in `build_app!'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:549:in `init_worker_process'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:567:in `worker_loop'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:475:in `spawn_missing_workers'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:486:in `maintain_worker_count'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:270:in `join'
        from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.0.1/bin/unicorn_rails:209:in `<top (required)>'
        from /usr/local/bin/unicorn_rails:19:in `load'
        from /usr/local/bin/unicorn_rails:19:in `<main>'
E, [2011-07-15T13:14:53.967107 #23269] ERROR -- : reaped #<Process::Status: pid 23274 exit 1> worker=0
I, [2011-07-15T13:14:53.967420 #23269]  INFO -- : master complete

Этот проект работал в Windows просто отлично (за исключением драгоценного камня Unicorn, поскольку он не совместим с Windows).

Project Gems

 root@server-pc:/usr/local/blog# bundle list
Gems included by the bundle:
  * actionmailer (3.1.0.rc4)
  * actionpack (3.1.0.rc4)
  * activemodel (3.1.0.rc4)
  * activerecord (3.1.0.rc4)
  * activeresource (3.1.0.rc4)
  * activesupport (3.1.0.rc4)
  * ansi (1.3.0)
  * arel (2.1.3)
  * bcrypt-ruby (2.1.4)
  * builder (3.0.0)
  * bundler (1.0.15)
  * capistrano (2.6.0)
  * devise (1.4.2)
  * erubis (2.7.0)
  * execjs (1.2.0)
  * highline (1.6.2)
  * hike (1.1.0)
  * i18n (0.6.0)
  * jquery-rails (1.0.12)
  * kgio (2.6.0)
  * libv8 (3.3.10.2)
  * mail (2.3.0)
  * mime-types (1.16)
  * multi_json (1.0.3)
  * net-scp (1.0.4)
  * net-sftp (2.0.5)
  * net-ssh (2.1.4)
  * net-ssh-gateway (1.1.0)
  * orm_adapter (0.0.5)
  * polyglot (0.3.1)
  * rack (1.3.0)
  * rack-cache (1.0.2)
  * rack-mount (0.8.1)
  * rack-ssl (1.3.2)
  * rack-test (0.6.0)
  * rails (3.1.0.rc4)
  * railties (3.1.0.rc4)
  * raindrops (0.7.0)
  * rake (0.9.2)
  * rdoc (3.8)
  * redcarpet (1.17.2)
  * sass (3.1.4)
  * sass-rails (3.1.0.rc.4)
  * sprockets (2.0.0.beta.10)
  * sqlite3 (1.3.3)
  * therubyracer (0.9.2)
  * thor (0.14.6)
  * tilt (1.3.2)
  * treetop (1.4.9)
  * turn (0.8.2)
  * tzinfo (0.3.29)
  * uglifier (1.0.0)
  * unicorn (4.0.1)
  * warden (1.0.4)

Установленные Gems (не обязательно связанные с Rails Project)

root@server-pc:/usr/local/blog# gem list

*** LOCAL GEMS ***

actionmailer (3.1.0.rc4)
actionpack (3.1.0.rc4)
activemodel (3.1.0.rc4)
activerecord (3.1.0.rc4)
activeresource (3.1.0.rc4)
activesupport (3.1.0.rc4)
addressable (2.2.6)
ansi (1.3.0)
arel (2.1.3)
bcrypt-ruby (2.1.4)
builder (3.0.0)
bundler (1.0.15)
capistrano (2.6.1.pre, 2.6.0)
devise (1.4.2, 1.2.rc2)
erubis (2.7.0)
execjs (1.2.0)
faraday (0.5.7)
highline (1.6.2)
hike (1.1.0)
i18n (0.6.0)
jquery-rails (1.0.12)
kgio (2.6.0)
libv8 (3.3.10.2 x86-linux)
mail (2.3.0)
mime-types (1.16)
minitest (1.6.0)
multi_json (1.0.3, 0.0.5)
multipart-post (1.1.2)
net-ldap (0.1.1)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.1.4)
net-ssh-gateway (1.1.0)
nokogiri (1.4.7)
oa-basic (0.2.0.beta5)
oa-core (0.2.0.beta5)
oa-enterprise (0.2.0.beta5)
oa-more (0.2.0.beta5)
oa-oauth (0.2.0.beta5)
oa-openid (0.2.0.beta5)
oauth (0.4.5)
oauth2 (0.1.1)
omniauth (0.2.0.beta5)
orm_adapter (0.0.5)
polyglot (0.3.1)
pyu-ruby-sasl (0.0.3.3)
rack (1.3.1, 1.3.0)
rack-cache (1.0.2)
rack-mount (0.8.1)
rack-openid (1.2.0)
rack-ssl (1.3.2)
rack-test (0.6.0)
rails (3.1.0.rc4)
railties (3.1.0.rc4)
raindrops (0.7.0)
rake (0.9.2, 0.8.7)
rdoc (3.8, 2.5.8)
redcarpet (1.17.2)
rest-client (1.6.3)
ruby-openid (2.1.8)
ruby-openid-apps-discovery (1.2.0)
rubyntlm (0.1.1)
sass (3.1.4)
sass-rails (3.1.0.rc.4)
sprockets (2.0.0.beta.10)
sqlite3 (1.3.3)
therubyracer (0.9.2)
thor (0.14.6)
tilt (1.3.2)
treetop (1.4.9)
turn (0.8.2)
tzinfo (0.3.29)
uglifier (1.0.0)
unicorn (4.0.1, 4.0.0.2.g19f7)
warden (1.0.4)

Ruby Version

root@server-pc:/usr/local/blog# ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

Это на серверена машине, на которой я ее развертываю, так что я бы предпочел, чтобы Ruby / Rails / Unicorn были все в качестве root.

Куда мне обратиться, чтобы Unicorn работал правильно?Это неправильная конфигурация (или отсутствие конфигурации) с моей стороны, или это ошибка в Unicorn?

Если что-то мне не хватает, чтобы помочь вам, помогите мне, пожалуйста, дайте мне знать.

1 Ответ

5 голосов
/ 16 июля 2011

Вы уже активировали стойку 1.3.1, но для вашего Gemfile требуется стойка 1.3.0.Рассмотрите возможность использования пакета exec.

... Рассмотрите возможность использования пакета exec.... Рассмотрите возможность использования пакета Exec.

.. эхо ..

...