Rails 4.1 AWS Beanstalk无法找到密钥库

CS *_*Koh 3 passenger amazon-web-services ruby-2.0 ruby-on-rails-4.1 amazon-elastic-beanstalk

我正在尝试在AWS Beanstalk上传我的rails项目.

我已经运行了eb init,eb start并配置了数据库设置以指向RDS.在我推动使用git aws.push并等待启动AWS服务器之后,提供的链接说:

 "502 Bad Gateway nginx"
Run Code Online (Sandbox Code Playgroud)

在日志中

-------------------------------------
/var/app/support/logs/passenger.log
-------------------------------------

App 6861 stderr: [ 2014-05-29 13:26:59.1308 6893/0x00000001e50050(Worker 1) utils.rb:68 ]: 
*** Exception RuntimeError in Rack application object (Missing `secret_key_base` for 
'production' environment, set this value in `config/secrets.yml`) (process 6893, thread 
0x00000001e50050(Worker 1)):
Run Code Online (Sandbox Code Playgroud)

在我的秘密.yml

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Run Code Online (Sandbox Code Playgroud)

CS *_*Koh 10

我做了以下事情并解决了问题,但感觉有点被迫,就像我在某个地方错过了一步.

  1. 转到弹性beanstalk - >应用程序 - >配置 - >软件配置

  2. 单击齿轮按钮

  3. 输入新的环境变量

    SECRET_KEY_BASE   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    Run Code Online (Sandbox Code Playgroud)
  4. 保存并等待AWS服务器重新启动