尝试运行Unicorn时,'监听循环错误:非套接字上的套接字操作'

时间:2015-04-26 03:58:26

标签: ruby-on-rails ruby unicorn

我上周开始研究其他人的Rails项目。在整个星期的工作中,一切都按预期工作,直到几天前我尝试在本地运行服务器(因为我已经做了很多次)。

该项目使用rake任务启动服务器,但我将问题缩小到只是试图让Unicorn运行。这是我在运行bundle exec unicorn后得到的错误:

I, [2015-04-25T20:38:10.794243 #1249]  INFO -- : listening on addr=0.0.0.0:8080 fd=9
I, [2015-04-25T20:38:10.794400 #1249]  INFO -- : worker=0 spawning...
I, [2015-04-25T20:38:10.795363 #1249]  INFO -- : master process ready
I, [2015-04-25T20:38:10.796474 #1250]  INFO -- : worker=0 spawned pid=1250
I, [2015-04-25T20:38:10.797102 #1250]  INFO -- : Refreshing Gem list
I, [2015-04-25T20:38:17.102292 #1250]  INFO -- : worker=0 ready
E, [2015-04-25T20:38:17.102705 #1250] ERROR -- : listen loop error: Socket operation on non-socket - accept (Errno::ENOTSOCK)
E, [2015-04-25T20:38:17.102861 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:669:in `kgio_tryaccept'
E, [2015-04-25T20:38:17.103015 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:669:in `worker_loop'
E, [2015-04-25T20:38:17.103201 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
E, [2015-04-25T20:38:17.103345 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in `start'
E, [2015-04-25T20:38:17.103473 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
E, [2015-04-25T20:38:17.103658 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/bin/unicorn:23:in `load'
E, [2015-04-25T20:38:17.103780 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/bin/unicorn:23:in `<main>'
E, [2015-04-25T20:38:17.103901 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/bin/ruby_executable_hooks:15:in `eval'
E, [2015-04-25T20:38:17.104022 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/bin/ruby_executable_hooks:15:in `<main>'
E, [2015-04-25T20:38:17.104289 #1250] ERROR -- : listen loop error: Socket operation on non-socket - accept (Errno::ENOTSOCK)
E, [2015-04-25T20:38:17.104379 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:669:in `kgio_tryaccept'
E, [2015-04-25T20:38:17.104533 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:669:in `worker_loop'
E, [2015-04-25T20:38:17.104711 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
E, [2015-04-25T20:38:17.104844 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in `start'
E, [2015-04-25T20:38:17.104977 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
E, [2015-04-25T20:38:17.105107 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/bin/unicorn:23:in `load'
E, [2015-04-25T20:38:17.105235 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/bin/unicorn:23:in `<main>'
E, [2015-04-25T20:38:17.105333 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/bin/ruby_executable_hooks:15:in `eval'
E, [2015-04-25T20:38:17.105465 #1250] ERROR -- : /Users/me/.rvm/gems/ruby-2.2.0@project_name/bin/ruby_executable_hooks:15:in `<main>'
E, [2015-04-25T20:38:17.105794 #1250] ERROR -- : listen loop error: Socket operation on non-socket - accept (Errno::ENOTSOCK)

这台机器上有多个项目,但我认为在工作状态和破坏状态之间都没有任何项目。

做了运行一次OSX更新,这个更新一直在早上骚扰我一周,所有这一切都破了。 Unicorn也在项目开始失败的那天更新了。但是我已经尝试将XCode恢复到旧版本,并且我尝试将Unicorn gem锁定到“工作”版本,并且它们似乎没有任何区别。

我也尝试过指定一个不同的端口,以防出现问题:bundle exec unicorn -p 4444,但无济于事。

感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

可能想要重建此应用程序的gemset。如果有的话,你将重新编译你的本土宝石。也许有一些优点,因为在Unicorn中发生了很大的错误。

结帐:RVM Gemset了解有关删除的信息

之后,继续bundle install。希望这能解决问题。