我刚刚开始使用Amazon Elastic Beanstalk . 我可以部署一个新的rails 4.2.5 rails app没问题 . 部署全新的RefineryCMS时遇到问题 .

这是我按顺序运行的命令;

refinerycms refinerycms_aws_test
cd refinerycms_aws_test

将'sqlite3'添加到Gemfile中

git init
g ca -m 'initial commit'
eb init

问题的答案;

  • 服务器:选择7(悉尼)

  • 应用程序:创建新的,"refinerycms"

  • Ruby?是

  • 平台:2 - (Ruby 2.1 Puma)

现在创建环境

eb create refinerycms-env

设置秘密令牌

eb setenv SECRET_KEY_BASE=27b39f037d544efc4671c707f68e54abcc6a61fa24a2664f0e4ae2871a932beb884288981eefcd4259a8c325ee44335231db04d6f58c8a75d3ac8d84e6e0dcf5
eb setenv SECRET_TOKEN=27b39f037d544efc4671c707f68e54abcc6a61fa24a2664f0e4ae2871a932beb884288981eefcd4259a8c325ee44335231db04d6f58c8a75d3ac8d84f6e0dce5

我得到的错误是'page not found 404'这里是 eb logs 命令给出的;

-------------------------------------
/var/log/puma/puma.log
-------------------------------------
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:246:in `env_config'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/engine.rb:514:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:165:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/configuration.rb:74:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:492:in `handle_request'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:363:in `process_client'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:254:in `block in run'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/thread_pool.rb:101:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/thread_pool.rb:101:in `block in spawn_thread'
2016-02-02 03:21:37 +0000: Rack app error: #<RuntimeError: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`>
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:534:in `validate_secret_key_config!'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:246:in `env_config'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/engine.rb:514:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:165:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/configuration.rb:74:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:492:in `handle_request'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:363:in `process_client'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:254:in `block in run'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/thread_pool.rb:101:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/thread_pool.rb:101:in `block in spawn_thread'
2016-02-02 03:21:55 +0000: Rack app error: #<RuntimeError: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`>
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:534:in `validate_secret_key_config!'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:246:in `env_config'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/engine.rb:514:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:165:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/configuration.rb:74:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:492:in `handle_request'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:363:in `process_client'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:254:in `block in run'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/thread_pool.rb:101:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/thread_pool.rb:101:in `block in spawn_thread'
2016-02-02 03:21:55 +0000: Rack app error: #<RuntimeError: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`>
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:534:in `validate_secret_key_config!'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:246:in `env_config'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/engine.rb:514:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:165:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/configuration.rb:74:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:492:in `handle_request'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:363:in `process_client'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/server.rb:254:in `block in run'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/thread_pool.rb:101:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/thread_pool.rb:101:in `block in spawn_thread'
2016-02-02 03:21:55 +0000: Rack app error: #<RuntimeError: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`>
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:534:in `validate_secret_key_config!'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:246:in `env_config'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/engine.rb:514:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:165:in `call'
/opt/rubies/ruby-2.1.7/lib/ruby/gems/2.1.0/gems/puma-2.10.2/lib/puma/configuration.rb:74:in `call'

它's complaining about the secret_token and secret_key_base but I'已经设置了这两个 . 当我使用 eb printenv 时它们会出现

UPDATE

这是我的secrets.yml文件

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
  secret_token: <%= ENV["SECRET_TOKEN"] %>

我通过eb工具设置了这两个 .

UPDATE

我在我的弹性beanstalk环境中添加了ssh并登录 . 我做了一个 env 命令,发现我的SECRET环境变量列在那里 . 所以他们正在设定 .