Unicorn + Sinatra + Nginx |添加侦听器

时间:2017-08-06 02:25:51

标签: ruby nginx sinatra unicorn

我有一个使用Nginx和Unicorn托管的Sinatra应用程序。当我在服务器上升级操作系统(Ubuntu 14.04.5 LTS)时它崩溃了,我能够将它们全部备份,除了这个,基于Rack的单独应用程序。当我尝试启动Unicorn(unicorn -c unicorn.rb -D)时,我收到以下错误:

I, [2017-08-06T15:39:54.426004 #6505]  INFO -- : unlinking existing socket=/tmp/unicorn.wheels-within-wheels.sock
F, [2017-08-06T15:39:54.427777 #6505] FATAL -- : error adding listener addr=/tmp/unicorn.wheels-within-wheels.sock
/home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/socket_helper.rb:113:in `unlink': Operation not permitted @ unlink_internal - /tmp/unicorn.wheels-within-wheels.sock (Errno::EPERM)
    from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/socket_helper.rb:113:in `$
    from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/socket_helper.rb:107:in `$
    from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:231:in `li$
    from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:808:in `bl$
    from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:808:in `ea$
    from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:808:in `bi$
    from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:130:in `st$
    from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/bin/unicorn:126:in `<top (required)>'
    from /home/deployer/.rbenv/versions/2.2.3/bin/unicorn:23:in `load'
    from /home/deployer/.rbenv/versions/2.2.3/bin/unicorn:23:in `<main>'

任何人都知道如何解决这个问题?感谢。

2 个答案:

答案 0 :(得分:1)

执行以下两个步骤后,它已修复:

  1. 如此服务器故障answer中所述,我将应用程序所有者“deployer”的组从“deployer”更改为“staff”。
  2. 我将套接字文件的所有者更改为deployer:staffsudo chown deployer:staff /tmp/unicorn.wheels-within-wheels.sock)。
  3. 然后我运行bundle update来更新宝石,最后Unicorn成功运行并且应用程序再次运行。

答案 1 :(得分:0)

以下链接表示将MacOSX升级到El Capitan时出现了一些问题。如果您可以遵循相同的路径,也许您可​​以解决问题。

ERROR: While executing gem ... (Errno::EPERM) Operation not permitted