Reputation: 5126
I've just started using Amazon Elastic Beanstalk. I can deploy a new rails 4.2.5 rails app no problem. I have a problem when deploying a brand new RefineryCMS.
Here are the commands I ran in order;
refinerycms refinerycms_aws_test
cd refinerycms_aws_test
add 'sqlite3' to the Gemfile
git init
g ca -m 'initial commit'
eb init
Answers to the questions;
Now create the environment
eb create refinerycms-env
Set the secret token
eb setenv SECRET_KEY_BASE=27b39f037d544efc4671c707f68e54abcc6a61fa24a2664f0e4ae2871a932beb884288981eefcd4259a8c325ee44335231db04d6f58c8a75d3ac8d84e6e0dcf5
eb setenv SECRET_TOKEN=27b39f037d544efc4671c707f68e54abcc6a61fa24a2664f0e4ae2871a932beb884288981eefcd4259a8c325ee44335231db04d6f58c8a75d3ac8d84f6e0dce5
The error I get is 'page not found 404' here is what the eb logs
command gives;
-------------------------------------
/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'
It's complaining about the secret_token and secret_key_base but I've set both of these. They show up when I use eb printenv
UPDATE
Here is my secrets.yml file
# 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"] %>
I've set both of these through the eb tool.
UPDATE
I added ssh to my elastic beanstalk environment and logged in. I did a env
command and found that my SECRET environment variables are listed there. So they are getting set.
Upvotes: 0
Views: 59