加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

ruby-on-rails-capistrano部署后ec2服务器中缺少puma.sock

发布时间:2020-12-13 20:56:09 所属栏目:Nginx 来源:网络整理
导读:在通过capistrano将生产中的ruby部署到ec2上的实例上后,我在nginx错误日志中收到以下错误.亚马逊公共主机显示502 Bad Gateway nginx / 1.10.0(Ubuntu). 我遵循了https://www.sitepoint.com/deploy-your-rails-app-to-aws/的教程 当我运行cap生产部署时,似乎

在通过capistrano将生产中的ruby部署到ec2上的实例上后,我在nginx错误日志中收到以下错误.亚马逊公共主机显示502 Bad Gateway nginx / 1.10.0(Ubuntu).
我遵循了https://www.sitepoint.com/deploy-your-rails-app-to-aws/的教程
当我运行cap生产部署时,似乎未创建puma.sock.

2017/06/28 01:09:57 [crit] 12802#12802: *1 connect() to unix:/home/deploy/app_name/shared/tmp/sockets/puma.sock failed (2: No such file or directory) while connecting to upstream,client: 173.198.30.2,server: localhost,request: "GET / HTTP/1.1",upstream: "http://unix:/home/deploy/app_name/shared/tmp/sockets/puma.sock:/",host: "host"

以下是我的deploy.rb中

set :application,'app_name'
set :repo_url,'git@github.com:github_account/app_name.git' # Edit this to match your repository
set :branch,:master
set :deploy_to,'/home/deploy/app_name'
set :pty,true
set :linked_files,%w{config/database.yml config/application.yml}
set :linked_dirs,%w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads}
set :keep_releases,5
set :rvm_type,:user
set :rvm_ruby_version,'ruby-2.3.3' # Edit this if you are using MRI Ruby

set :puma_rackup,-> { File.join(current_path,'config.ru') }
set :puma_state,"#{shared_path}/tmp/pids/puma.state"
set :puma_pid,"#{shared_path}/tmp/pids/puma.pid"
set :puma_bind,"unix://#{shared_path}/tmp/sockets/puma.sock"    #accept array for multi-bind
set :puma_conf,"#{shared_path}/puma.rb"
set :puma_access_log,"#{shared_path}/log/puma_error.log"
set :puma_error_log,"#{shared_path}/log/puma_access.log"
set :puma_role,:app
set :puma_env,fetch(:rack_env,fetch(:rails_env,'production'))
set :puma_threads,[0,8]
set :puma_workers,0
set :puma_worker_timeout,nil
set :puma_init_active_record,true
set :puma_preload_app,false

请帮忙!
提前致谢!

最佳答案
在使用Capistrano和Nginx安装Rails的EC2实例上工作时,我遇到了同样的错误

如果收到502错误,则在需要’capistrano / puma’之后,将install_plugin Capistrano :: Puma添加到Capfile中.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读