我一直在Unicorn 5.5.5上运行Rails应用程序,在某些环境中,它会抛出一个异常,内容如下:
bundler: failed to load command: unicorn (/usr/local/bundle/bin/unicorn)
Errno::EPERM: Operation not permitted
/usr/local/bundle/gems/unicorn-5.5.0/lib/unicorn.rb:123:in `fcntl'
/usr/local/bundle/gems/unicorn-5.5.0/lib/unicorn.rb:123:in `block in pipe'
/usr/local/bundle/gems/unicorn-5.5.0/lib/unicorn.rb:116:in `each'
/usr/local/bundle/gems/unicorn-5.5.0/lib/unicorn.rb:116:in `pipe'
/usr/local/bundle/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:126:in `start'
/usr/local/bundle/gems/unicorn-5.5.0/bin/unicorn:128:in `<top (required)>'
/usr/local/bundle/bin/unicorn:23:in `load'
/usr/local/bundle/bin/unicorn:23:in `<top (required)>
我想了解fcntl
的作用以及为什么要添加此补丁。我不太了解 IO 管道的内部结构以及此处描述的代码 https://github.com/defunkt/unicorn/blob/master/lib/unicorn.rb#L115 和此处 https://bogomips.org/unicorn-public/20180820203038.25464-1-e@80x24.org/T/
有人可以解释为什么需要这样做以及它实际上做了什么吗?
我们已将
独角兽降级到 v5.4.1,一切恢复正常。我知道这不是解决方案,但它有助于暂时解决问题。