Typo in `secrets.yml`
After running rake db:seed
, the puma server starts, but I get a message in the browser that there's a low-level error, and the terminal shows a runtime error:
#<RuntimeError: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`>
To fix it, I have to change the config/secrets.yml
file: there's a typo on line 35:
secret_key_base: <%= ENV['SECREY_KEY_BASE'] %>
should be
secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
After that change, rake db:seed
runs fine.
Here's the full original error log:
root@601c229318f3:/app# rake db:seed
Folding contents of StepGemfile into Gemfile
"Loading file location from ENV[PRODUCTION_FILE_LOCATION]"
"File location set to /ink-api/ink_api_files/"
root@601c229318f3:/app# ./bin/server
Folding contents of StepGemfile into GemfileFolding contents of StepGemfile into Gemfile
Folding contents of StepGemfile into Gemfile
=> Booting Puma
=> Rails 5.0.0.1 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
"Loading file location from ENV[PRODUCTION_FILE_LOCATION]"
"File location set to /ink-api/ink_api_files/"
"Loading file location from ENV[PRODUCTION_FILE_LOCATION]"
"File location set to /ink-api/ink_api_files/"
Puma starting in single mode...
* Version 3.10.0 (ruby 2.2.3-p173), codename: Russell's Teapot
* Min threads: 50, max threads: 50
* Environment: production
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
2017-10-18T14:32:04.771Z 13447 TID-gsmaa42vc INFO: Running in ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
2017-10-18T14:32:04.771Z 13447 TID-gsmaa42vc INFO: See LICENSE and the LGPL-3.0 for licensing details.
2017-10-18T14:32:04.771Z 13447 TID-gsmaa42vc INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
2017-10-18T14:32:04.772Z 13447 TID-gsmaa42vc INFO: Booting Sidekiq 5.0.2 with redis options {:url=>"redis://redis:6379"}
2017-10-18T14:32:04.779Z 13447 TID-gsmaa42vc INFO: Starting processing, hit Ctrl-C to stop
2017-10-18 14:32:11 +0000: Rack app error handling request { GET / }
#<RuntimeError: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`>
/gems/gems/railties-5.0.0.1/lib/rails/application.rb:513:in `validate_secret_key_config!'
/gems/gems/railties-5.0.0.1/lib/rails/application.rb:246:in `env_config'
/gems/gems/railties-5.0.0.1/lib/rails/engine.rb:693:in `build_request'
/gems/gems/railties-5.0.0.1/lib/rails/application.rb:521:in `build_request'
/gems/gems/railties-5.0.0.1/lib/rails/engine.rb:521:in `call'
/gems/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call'
/gems/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request'
/gems/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client'
/gems/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run'
/gems/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `call'
/gems/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
2017-10-18 14:32:11 +0000: Rack app error handling request { GET /favicon.ico }
#<RuntimeError: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`>
/gems/gems/railties-5.0.0.1/lib/rails/application.rb:513:in `validate_secret_key_config!'
/gems/gems/railties-5.0.0.1/lib/rails/application.rb:246:in `env_config'
/gems/gems/railties-5.0.0.1/lib/rails/engine.rb:693:in `build_request'
/gems/gems/railties-5.0.0.1/lib/rails/application.rb:521:in `build_request'
/gems/gems/railties-5.0.0.1/lib/rails/engine.rb:521:in `call'
/gems/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call'
/gems/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request'
/gems/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client'
/gems/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run'
/gems/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `call'
/gems/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
^C2017-10-18T14:35:38.998Z 13447 TID-gsmaa42vc INFO: Shutting down
2017-10-18T14:35:38.999Z 13447 TID-gsmaa42vc INFO: Terminating quiet workers
2017-10-18T14:35:38.999Z 13447 TID-gsmarpagg INFO: Scheduler exiting...
- Gracefully stopping, waiting for requests to finish
=== puma shutdown: 2017-10-18 14:35:39 +0000 ===
- Goodbye!
Exiting
2017-10-18T14:35:39.100Z 13447 TID-gsmaa42vc INFO: Pausing to allow workers to finish...