我在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连接()到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:/”,host:“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

能否请你帮忙?