在Elastic Beanstalk上部署错误-Rails

时间:2018-12-26 22:28:24

标签: ruby-on-rails ruby ruby-on-rails-5 amazon-elastic-beanstalk

我正在尝试在Elastic Beanstalk上部署自定义项目,但是启动puma时,我的puma.log文件中出现以下错误。我不确定如何解决此问题。我假设它可能与我的yaml解析器一起使用,但是我不确定如何使用EB更新它。任何帮助将不胜感激。

=== puma startup: 2018-12-26 22:06:02 +0000 ===
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/psych.rb:402:in 'parse': (<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 83 column 22 (Psych::SyntaxError)
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/psych.rb:402:in 'parse_stream'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/psych.rb:350:in 'parse'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/psych.rb:263:in 'load'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/secrets.rb:27:in 'block in parse'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/secrets.rb:24:in 'each'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/secrets.rb:24:in 'each_with_object'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/secrets.rb:24:in 'parse'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/application.rb:391:in 'secrets'
from /var/app/current/config/environments/production.rb:96:in 'block in <top (required)>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/railtie.rb:211:in 'instance_eval'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/railtie.rb:211:in 'configure'
from /var/app/current/config/environments/production.rb:1:in '<top (required)>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in 'require'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in 'block in require'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:258:in 'load_dependency'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in 'require'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:600:in 'block (2 levels) in <class:Engine>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:599:in 'each'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:599:in 'block in <class:Engine>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:30:in 'instance_exec'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:30:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:59:in 'block in run_initializers'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:228:in 'block in tsort_each'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:350:in 'block (2 levels) in each_strongly_connected_component'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:422:in 'block (2 levels) in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:431:in 'each_strongly_connected_component_from'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:421:in 'block in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:48:in 'each'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:48:in 'tsort_each_child'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:415:in 'call'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:415:in 'each_strongly_connected_component_from'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:349:in 'block in each_strongly_connected_component'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in 'each'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in 'call'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in 'each_strongly_connected_component'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:226:in 'tsort_each'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:205:in 'tsort_each'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:58:in 'run_initializers'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/application.rb:353:in 'initialize!'
from /var/app/current/config/environment.rb:5:in '<top (required)>'
from config.ru:3:in 'require_relative'
from config.ru:3:in 'block in <main>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in 'instance_eval'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in 'initialize'
from config.ru:in 'new'
from config.ru:in '<main>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in 'eval'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in 'new_from_string'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in 'parse_file'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/configuration.rb:318:in 'load_rackup'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/configuration.rb:243:in 'app'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/runner.rb:155:in 'app'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/runner.rb:162:in 'start_server'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:273:in 'worker'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:137:in 'block (2 levels) in spawn_workers'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:137:in 'fork'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:137:in 'block in spawn_workers'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:133:in 'times'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:133:in 'spawn_workers'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:466:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/launcher.rb:184:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cli.rb:78:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/bin/puma:10:in '<top (required)>'
from /opt/rubies/ruby-2.5.3/bin/puma:23:in 'load'
from /opt/rubies/ruby-2.5.3/bin/puma:23:in '<top (required)>'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:74:in 'load'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:74:in 'kernel_load'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:28:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:424:in 'exec'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/command.rb:27:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in 'invoke_command'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor.rb:387:in 'dispatch'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:27:in 'dispatch'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/base.rb:466:in 'start'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:18:in 'start'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.16.2/exe/bundle:30:in 'block in <top (required)>'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/friendly_errors.rb:124:in 'with_friendly_errors'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.16.2/exe/bundle:22:in '<top (required)>'
from /opt/rubies/ruby-2.5.3/bin/bundle:23:in 'load'
from /opt/rubies/ruby-2.5.3/bin/bundle:23:in '<main>'

我今天再次检查了日志以确保没有遗漏任何东西,并且在不同的日志文件中确实看到了对同一错误的另一个引用,但仍然告诉我很少。

-------------------------------------
/var/log/eb-commandprocessor.log
-------------------------------------
++ [[ -z /opt/rubies/ruby-2.5.3 ]]
++ shift
++ chruby_use /opt/rubies/ruby-2.5.3 ''
++ [[ ! -x /opt/rubies/ruby-2.5.3/bin/ruby ]]
++ [[ -n '' ]]
++ export RUBY_ROOT=/opt/rubies/ruby-2.5.3
++ RUBY_ROOT=/opt/rubies/ruby-2.5.3
++ export RUBYOPT=
++ RUBYOPT=
++ export PATH=/opt/rubies/ruby-2.5.3/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
++ PATH=/opt/rubies/ruby-2.5.3/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
+++ /opt/rubies/ruby-2.5.3/bin/ruby -
++ eval 'export RUBY_ENGINE=ruby;
export RUBY_VERSION=2.5.3;
export GEM_ROOT="/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0";'
+++ export RUBY_ENGINE=ruby
+++ RUBY_ENGINE=ruby
+++ export RUBY_VERSION=2.5.3
+++ RUBY_VERSION=2.5.3
+++ export GEM_ROOT=/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0
+++ GEM_ROOT=/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0
++ ((  0 != 0  ))
+ cd /var/app/ondeck
+ su -s /bin/bash -c 'bundle exec /opt/elasticbeanstalk/support/scripts/check-for-rake-task.rb assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
+ '[' false == true ']'
+ su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
rake aborted!
Psych::SyntaxError: (<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 83 column 22
/var/app/ondeck/config/environments/production.rb:96:in `block in <top (required)>'
/var/app/ondeck/config/environments/production.rb:1:in `<top (required)>'
/var/app/ondeck/config/environment.rb:5:in `<top (required)>'
/opt/rubies/ruby-2.5.3/bin/bundle:23:in `load'
/opt/rubies/ruby-2.5.3/bin/bundle:23:in `<main>'
Tasks: TOP => environment
(See full trace by running task with --trace) (Executor::NonZeroExitStatus)

1 个答案:

答案 0 :(得分:0)

如果您在app/shared/assets下有任何.json清单文件,请尝试将其删除。

此外,由于错误的YAML文件,可能会出现此错误。您可以通过运行此小脚本(在您的Rails根目录中)检查此内容,该脚本在所有子目录中递归查找所有* .yml文件并测试该文件。

require 'yaml'

d = Dir["./**/*.yml"]
d.each do |file|
  begin
    puts "checking : #{file}"
    f =  YAML.load_file(file)
  rescue StandardError
    puts "failed to read #{file}: #{$!}"
  end
end