Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 无法在Elastic Beanstalk上部署带有Puma的Rails应用程序_Ruby_Ruby On Rails 4_Deployment_Amazon Elastic Beanstalk_Puma - Fatal编程技术网

Ruby 无法在Elastic Beanstalk上部署带有Puma的Rails应用程序

Ruby 无法在Elastic Beanstalk上部署带有Puma的Rails应用程序,ruby,ruby-on-rails-4,deployment,amazon-elastic-beanstalk,puma,Ruby,Ruby On Rails 4,Deployment,Amazon Elastic Beanstalk,Puma,经过近三周的尝试,我无法将我的应用程序部署到rails。我正在使用64位Amazon Linux 2014.03 v1.0.5,运行Ruby 2.0(Puma)和Ruby 2.0.0 我在部署阶段没有错误消息: 当我访问url时,没有收到错误消息: 这是我的/var/log/directory hooks executor.log Using declarative_authorization (0.5.7) Using orm_adapter (0.5.0) Using warden

经过近三周的尝试,我无法将我的应用程序部署到rails。我正在使用64位Amazon Linux 2014.03 v1.0.5,运行Ruby 2.0(Puma)和Ruby 2.0.0

我在部署阶段没有错误消息:

当我访问url时,没有收到错误消息:

这是我的/var/log/directory hooks executor.log

Using declarative_authorization (0.5.7) 
Using orm_adapter (0.5.0) 
Using warden (1.2.3) 
Using devise (3.2.4) 
Using exception_notification (4.0.1) 
Using exception_notification-rake (0.1.2) 
Using excon (0.37.0) 
Using multipart-post (2.0.0) 
Using faraday (0.9.0) 
Using httpclient (2.4.0) 
Using rack-oauth2 (1.0.8) 
Using fb_graph (2.7.15) 
Using hashie (2.1.2) 
Using heroku-api (0.3.18) 
Using launchy (2.4.2) 
Using netrc (0.7.7) 
Using rest-client (1.6.7) 
Using rubyzip (1.1.6) 
Using heroku (3.9.0) 
Using hike (1.2.3) 
Using httpauth (0.2.1) 
Using jbuilder (1.5.3) 
Using jquery-rails (3.1.1) 
Using jwt (0.1.13) 
Using libv8 (3.16.14.3) 
Using mysql2 (0.3.16) 
Using newrelic_rpm (3.9.0.229) 
Using oauth2 (0.8.1) 
Using omniauth (1.2.1) 
Using omniauth-oauth2 (1.0.3) 
Using omniauth-facebook (1.4.0) 
Using paper_trail (3.0.3) 
Using paperclip (4.1.1) 
Using puma (2.9.0) 
Using bundler (1.3.5) 
Using tilt (1.4.1) 
Using sprockets (2.11.0) 
Using sprockets-rails (2.0.1) 
Using rails (4.0.0) 
Using rails_serve_static_assets (0.0.2) 
Using rails_stdout_logging (0.0.3) 
Using rails_12factor (0.0.2) 
Using rdoc (4.1.1) 
Using ref (1.0.5) 
Using sass (3.2.19) 
Using sass-rails (4.0.3) 
Using sdoc (0.4.0) 
Using therubyracer (0.12.1) 
Using turbolinks (2.2.2) 
Using uglifier (2.5.1) 
Using will_paginate (3.0.7) 
Using will_paginate-bootstrap (1.0.1) 
Using youtube_search (0.1.9) 
Updating files in vendor/cache
Your bundle is complete!
Gems in the groups test and development were not installed.
It was installed into ./vendor/bundle
+ '[' 0 '!=' 0 ']'
+ echo 'bundle install --deployment --deployment succeeded'
bundle install --deployment --deployment succeeded
+ '[' -f Gemfile.lock ']'
+ echo 'encountered a Gemfile.lock, setting proper permissions'
encountered a Gemfile.lock, setting proper permissions
+ chown webapp:webapp Gemfile.lock
+ '[' '' = 1 ']'
+ true

2014-07-31 13:10:05,023 [INFO] (18794 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded.
2014-07-31 13:10:05,023 [INFO] (18794 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing script: /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh
2014-07-31 13:10:05,537 [INFO] (18794 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: running 'bundle exec bundle exec rake assets:precompile'...
bundler: command not found: bundle
Install missing gem executables with `bundle install`
Rake task failed to run, skipping asset compilation.

2014-07-31 13:10:05,538 [INFO] (18794 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded.
2014-07-31 13:10:05,538 [INFO] (18794 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing script: /opt/elasticbeanstalk/hooks/appdeploy/pre/12_db_migration.sh
2014-07-31 13:10:06,041 [INFO] (18794 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: bundler: command not found: bundle
Install missing gem executables with `bundle install`
Rake task failed to run, skipping database migrations.

2014-07-31 13:10:06,041 [INFO] (18794 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded.
2014-07-31 13:10:06,186 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing directory: /opt/elasticbeanstalk/hooks/appdeploy/enact/
2014-07-31 13:10:06,186 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing script: /opt/elasticbeanstalk/hooks/appdeploy/enact/01_flip.sh
2014-07-31 13:10:06,304 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: + '[' -d /var/app/current ']'
+ rm -rf /var/app/current.old
+ mv /var/app/current /var/app/current.old
+ mv /var/app/ondeck /var/app/current
+ rm -rf /var/app/current.old
+ su -c 'mkdir -p /var/app/current/{tmp,public}' webapp

2014-07-31 13:10:06,305 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded.
2014-07-31 13:10:06,305 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing script: /opt/elasticbeanstalk/hooks/appdeploy/enact/02_restart_app_server.sh
2014-07-31 13:10:08,333 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: puma start/running, process 18871

2014-07-31 13:10:08,334 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded.
2014-07-31 13:10:08,334 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing script: /opt/elasticbeanstalk/hooks/appdeploy/enact/09clean.sh
2014-07-31 13:10:08,358 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: 
2014-07-31 13:10:08,359 [INFO] (18857 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded.
2014-07-31 13:10:08,647 [INFO] (18879 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing directory: /opt/elasticbeanstalk/hooks/appdeploy/post/
2014-07-31 13:10:08,647 [INFO] (18879 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] No files found to execute.
我有一个数据库,实例类型是t1.micro


有人知道我遇到了什么问题,或者如何着手修复错误吗?谢谢。

如日志所示:

执行脚本:
/opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh
2014-07-31 13:10:05537[信息](18794主线程) [directoryHooksEcutor.py-29][root directoryHooksEcutor信息]
脚本输出:运行“bundle exec bundle exec rake”
资产:预编译“…”

bundler: command not found: bundle
脚本:
opt/elasticbeanstalk/hooks/appdeploy/pre/11\u asset\u compilation.sh


正在尝试运行bundle exec bundle exec…-某些配置不正确,请检查您的配置文件。

我在Rails和Puma上也有同样的问题。所有EB钩子运行时都不会出错,但服务器不会响应任何内容,也不会在/var/log/puma/puma.log中抛出错误

尽管如此,您的脚本(可能在.ebextensions/*.config中过度隐藏)现在仍然不正确。
您需要先解决这个问题。

我遇到了同样的问题,在Elastic Beanstalk仪表板中,检查加载URL时CPU使用情况的监控。如果它接近100%,这意味着您需要一个更高层次的实例,因为需要安装gem和依赖项。

Hi,好的,我认为.ebextensions文件夹中.config文件中的命令格式不正确(即使部署时没有错误)。但是我不能把它贴在这里,它太长了。我必须研究正确的格式。港口也开放了。谢谢你的回复,我在这个过程中迷失了方向,我想我会放弃这次尝试,如果我回来,我一定会回复的。我理解你的答案和之前的答案,但我一点运气都没有。