connect()到unix:/ app_path / shared / sockets / unicorn。[app] .sock失败。没有相应的文件和目录

时间:2015-08-17 03:24:32

标签: ruby-on-rails sockets unix nginx unicorn

我在Ubuntu 14.04上使用capistrano gem部署了一个Rails应用程序。使用Nginx,独角兽。

我已经从http://requiremind.com/deploying-a-rails-app-on-your-own-server-the-ultimate-guide/跟踪了部署中的所有步骤,但似乎无法正常工作。我收到了消息

  

"我们很抱歉,但出了点问题。"

已验证的nginx已启动

sudo netstat -plutn | grep :80

输出

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 27525/nginx

这是/var/log/nginx/error.log

  

* 7 connect()到unix:/home/user/apps/my_app/shared/sockets/unicorn.2dotO.sock失败   (2:没有这样的文件或目录)连接上游时,客户端:   client_ip_address,server :, request:" GET / HTTP / 1.1",上游:   " http://unix:/home/user/apps/my_app/shared/sockets/unicorn.2dotO.sock:/&#34 ;,   主持人:" server_ip_address"

但是文件unicorn.2dotO.sock存在于该位置。并且不确定为什么这不起作用!

Unicorn.rb文件

app_dir    = "/home/user/apps/my_app"
shared_dir = "#{app_dir}/shared"
root       = "#{app_dir}/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"

listen "#{shared_dir}/sockets/unicorn.2dot0.sock"
worker_processes 2
timeout 30

# Force the bundler gemfile environment variable to
# reference the capistrano "current" symlink
before_exec do |_|
  ENV["BUNDLE_GEMFILE"] = File.join(root, 'Gemfile')
end

你能帮忙吗?

0 个答案:

没有答案