ruby-on-rails-4 - 带有运行 Puma 和 Nginx 的 AWS Elastic Beanstalk 的 Rails 应用程序 502

标签 ruby-on-rails-4 amazon-web-services nginx amazon-elastic-beanstalk puma

我已经能够成功地让我的应用程序在 Beanstalk 上与乘客一起运行,但是我对 Puma 没有运气。每当我部署到 Puma 堆栈时,我都会收到 502 错误,我的日志文件表明它找不到 puma sock 文件:
2014/05/15 21:00:15 [crit] 1684#0: *4 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 10.184.156.117, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "app-env-89spnxpcai.elasticbeanstalk.com"
我的应用程序是使用 Ruby ruby​​ 2.0.0p451 & Rails 4.1.1 构建的

我的 .ebextensions 配置如下所示

packages:
  yum:
    git: []

commands:
  add_bundle_exec:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: perl -pi -e 's/(rake)/bundle exec $1/' 11_asset_compilation.sh 12_db_migration.sh
  add_deployment_flag:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: perl -pi -e 's/(bundle install)/$1 --deployment/' 10_bundle_install.sh
  make_vendor_bundle_dir:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    command: mkdir /var/app/support/vendor_bundle
  set_vendor_bundle_var:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/support
    command: sed -i '12iexport EB_CONFIG_APP_VENDOR_BUNDLE=$EB_CONFIG_APP_SUPPORT/vendor_bundle' envvars
  symlink_vendor_bundle:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: sed -i 's/\(^cd $EB_CONFIG_APP_ONDECK\)/\1\nln -s $EB_CONFIG_APP_VENDOR_BUNDLE .\/vendor\/bundle/' 10_bundle_install.sh
  z_write_post_provisioning_complete_file:
    cwd: /opt/elasticbeanstalk/support
    command: touch .post-provisioning-complete 

我做错了什么,我需要什么特别的东西才能让它与 Puma 一起工作吗?

最佳答案

最新版本不会出现此问题 - 运行 Ruby 2.0 (Puma) 的 64 位 Amazon Linux 2014.03 v1.0.5

关于ruby-on-rails-4 - 带有运行 Puma 和 Nginx 的 AWS Elastic Beanstalk 的 Rails 应用程序 502,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23698342/

相关文章:

javascript - 刷新页面后表格行恢复原位

ruby-on-rails - 将 Rails 服务器从本地机器连接到网络

amazon-web-services - aws cloudformation Elasticsearch 堆栈

amazon-web-services - 由 Elastic Transcoder 从 GIF 转码的视频伪影

azure - 连接到 Azure B2C 时如何调试 oauth2_proxy?

tomcat - Nginx + Tomcat 在同一台服务器上工作

ruby-on-rails-4 - 无法在Rails4中将.xls注册为自定义MIME类型

apache - htaccess在localhost中有效,但在EC2实例中无效

javascript - 为 Django 的 NGINX 服务器上的 CSS 和 JS 文件启用 GZIP

ruby-on-rails - 动态站点地图错误