I have successfully installed rails with Passenger+Nginx but am experiencing an Incomplete response error via the web browser:
http://tenklakes.northcentralus.cloudapp.azure.com/
I have tried rake secrets
to generate a new secret_key_base
for production
in my secrets.yml
file with no luck.
Secrets.yml :
development:
secret_key_base:c70c590cfe799087c47528016ab49a1a8e57fe2eb851639e27e2ea66f92f241a0400b3d4247e3d61a6c82818dd3988825deeb66e783ba90cfccfbc0c500d6dbd
test:
secret_key_base: 08b1ebf5defee2eb1ad196e9780ae118f256c9f40f40f76674451dac4dfb1c42b75f04d22ee264644711de4e547ac8f58031e88f09c5c7223834b99230fb205c
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
when I run curl http:0.0.0.0:3000
I receive the following from Passenger:
Started GET "/" for 127.0.0.1 at 2016-10-09 04:52:43 +0000
Processing by Rails::WelcomeController#index as */*
Parameters: {"internal"=>true}
Rendering /home/garrett/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/templates/rails/welcome/index.html.erb
Rendered /home/garrett/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/templates/rails/welcome/index.html.erb (2.5ms)
Completed 200 OK in 10ms (Views: 6.2ms | ActiveRecord: 0.0ms)
NGINX error.log :
[ 2016-10-09 04:49:44.8271 45647/7fe3b30d4700 age/Cor/Con/InternalUtils.cpp:112 ]: [Client 1-3] Sending 502 response: application did not send a complete response App 45674 stderr: [ 2016-10-09 04:49:56.0108 45754/0x0000000092d678(Worker 1) utils.rb:87 ]: *** Exception RuntimeError in Rack application object (Missing
secret_key_base
for 'production' environment, set this value inconfig/secrets.yml
) (process 45754, thread 0x0000000092d678(Worker 1)): App 45674 stderr: from /home/garrett/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:513:invalidate_secret_key_config!' App 45674 stderr: from /home/garrett/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:246:in
env_config' App 45674 stderr: from /home/garrett/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:693:inbuild_request' App 45674 stderr: from /home/garrett/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:521:in
build_request' App 45674 stderr: from /home/garrett/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:521:incall' App 45674 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in
process_request' App 45674 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152:inaccept_and_process_next_request' App 45674 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in
main_loop' App 45674 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:inblock (3 levels) in start_threads' App 45674 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in
block in create_thread_and_abort_on_exception'
I am out of ideas to get this working - is there anything else I should be checking?
EDIT: Here is what I get when running 'grep -r ENV *'
garrett@10klakes:~/lakemag$ grep -r ENV *
bin/bundle:ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
config/database.yml: pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
config/database.yml:# url: <%= ENV['DATABASE_URL'] %>
config/database.yml: password: <%= ENV['LAKEMAG_DATABASE_PASSWORD'] %>
config/puma.rb:threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
config/puma.rb:port ENV.fetch("PORT") { 3000 }
config/puma.rb:environment ENV.fetch("RAILS_ENV") { "development" }
config/puma.rb:# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
config/environments/production.rb: # config.secret_key_base = ENV["SECRET_KEY_BASE"]
config/environments/production.rb: config.secret_key_base = ENV["SECRET_KEY_BASE"]
config/environments/production.rb: config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config/environments/production.rb: if ENV["RAILS_LOG_TO_STDOUT"].present?
config/boot.rb:ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
config/secrets.yml: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
test/test_helper.rb:ENV['RAILS_ENV'] ||= 'test'