由于Errno :: EPERM,Unicorn无法在Vagrant盒子上启动

前端之家收集整理的这篇文章主要介绍了由于Errno :: EPERM,Unicorn无法在Vagrant盒子上启动前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我运行以下命令为我的Vagrant盒子上的Sinatra应用程序启动Unicorn时(ubuntu-12.04.2-server-i386)
  1. sudo unicorn -c unicorn.rb -E development -D -l 0.0.0.0:8080

我在Unicorn日志中收到以下错误.

  1. I,[2013-05-05T19:15:15.538805 #2357] INFO -- : listening on addr=0.0.0.0:8080 fd=5
  2. F,[2013-05-05T19:15:15.541673 #2357] FATAL -- : error adding listener addr=/home/vagrant/tmp/myapp/sockets/unicorn.sock
  3. /home/vagrant/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/unicorn-4.3.1/lib/unicorn/socket_helper.rb:140:in `initialize': Operation not permitted - "/home/vagrant/tmp/myapp/sockets/unicorn.sock" (Errno::EPERM)

我以流浪者用户身份登录,并按照http://recipes.sinatrarb.com/p/deployment/nginx_proxied_to_unicorn配置了unicorn.rb

  1. @dir = '/home/vagrant/myapp/'
  2.  
  3. worker_processes 4
  4. working_directory @dir
  5.  
  6. timeout 30
  7.  
  8. listen "#{@dir}tmp/sockets/unicorn.sock",:backlog => 64
  9. pid "#{@dir}tmp/pids/unicorn.pid"
  10.  
  11. stderr_path "#{@dir}log/unicorn.stderr.log"
  12. stdout_path "#{@dir}log/unicorn.stdout.log"

我查看了代码,但无法初始化以下内容

  1. Kgio::UNIXServer.new('0.0.0.0:8080')

解决方法

Unicorn无法在Virtual Box共享文件夹上存储.sock文件,因此您需要做的是从以下位置修改套接字:
  1. listen "#{@dir}tmp/sockets/unicorn.sock",:backlog => 64

对此:

  1. listen "/tmp/sockets/unicorn.sock",:backlog => 64

或者VBox共享文件夹之外的其他位置.

猜你在找的CSS相关文章