Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails SECRET_KEY_BASE config vars设置太晚-Can';t在Heroku上启动Rails应用程序_Ruby On Rails_Heroku - Fatal编程技术网

Ruby on rails SECRET_KEY_BASE config vars设置太晚-Can';t在Heroku上启动Rails应用程序

Ruby on rails SECRET_KEY_BASE config vars设置太晚-Can';t在Heroku上启动Rails应用程序,ruby-on-rails,heroku,Ruby On Rails,Heroku,运行时错误,在Heroku上启动Rails应用程序时缺少密钥库。 我已经将这个秘密添加为ENV var,查看日志,感觉Heroku设置得太晚了。 类似的事情发生在你身上了吗?您建议如何处理此问题 2016-12-18T01:57:34.469373+00:00 app[web.1]: #<RuntimeError: Missing `secret_key_base` for 'production' environment, set this value in `config/secret

运行时错误,在Heroku上启动Rails应用程序时缺少密钥库。 我已经将这个秘密添加为ENV var,查看日志,感觉Heroku设置得太晚了。
类似的事情发生在你身上了吗?您建议如何处理此问题

2016-12-18T01:57:34.469373+00:00 app[web.1]: #<RuntimeError: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`>
2016-12-18T01:57:34.469375+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:513:in `validate_secret_key_config!'
2016-12-18T01:57:34.469376+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:246:in `env_config'
2016-12-18T01:57:34.469377+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:521:in `build_request'
2016-12-18T01:57:34.469377+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:693:in `build_request'
2016-12-18T01:57:34.469378+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:521:in `call'
2016-12-18T01:57:34.469379+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/configuration.rb:225:in `call'
2016-12-18T01:57:34.469379+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/server.rb:578:in `handle_request'
2016-12-18T01:57:34.469380+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/server.rb:415:in `process_client'
2016-12-18T01:57:34.469381+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/server.rb:275:in `block in run'
2016-12-18T01:57:34.469381+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/thread_pool.rb:116:in `call'
2016-12-18T01:57:34.469382+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/thread_pool.rb:116:in `block in spawn_thread'
2016-12-18T02:32:44.013101+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-12-18T02:32:43.362607+00:00 heroku[web.1]: Idling
2016-12-18T02:32:43.362607+00:00 heroku[web.1]: State changed from up to down
2016-12-18T02:32:44.038208+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2016-12-18T02:32:44.038778+00:00 app[web.1]: - Goodbye!
2016-12-18T02:32:44.038774+00:00 app[web.1]: === puma shutdown: 2016-12-18 02:32:44 +0000 ===
2016-12-18T02:32:44.039352+00:00 app[web.1]: Exiting
2016-12-18T02:32:44.259020+00:00 heroku[web.1]: Process exited with status 0
2016-12-18T09:45:45.086929+00:00 heroku[web.1]: State changed from down to starting
2016-12-18T09:45:44.933284+00:00 app[api]: Set SECRET_KEY_BASE config vars by user XXX@gmail.com
2016-12-18T09:45:44.933284+00:00 app[api]: Release v12 created by user XXX@gmail.com
2016-12-18T01:57:34.469373+00:00应用程序[网站1]:#
2016-12-18T01:57:34.469375+00:00 app[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:513:in'validate_secret_key_config!'
2016-12-18T01:57:34.469376+00:00 app[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:246:in'env_config'
2016-12-18T01:57:34.469377+00:00 app[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:521:in'build_request'
2016-12-18T01:57:34.469377+00:00应用程序[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:693:in'build_request'
2016-12-18T01:57:34.469378+00:00 app[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:521:in'call'
2016-12-18T01:57:34.469379+00:00 app[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/configuration.rb:225:in'call'
2016-12-18T01:57:34.469379+00:00 app[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/server.rb:578:in'handle_request'
2016-12-18T01:57:34.469380+00:00应用程序[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/server.rb:415:in'process_client'
2016-12-18T01:57:34.469381+00:00应用程序[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/server.rb:275:在“运行中的块”中
2016-12-18T01:57:34.469381+00:00 app[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/thread_pool.rb:116:in'call'
2016-12-18T01:57:34.469382+00:00应用程序[web.1]:/app/vendor/bundle/ruby/2.2.0/gems/puma-3.6.2/lib/puma/thread_pool.rb:116:in`block in spawn_thread'
2016-12-18T02:32:44.013101+00:00 heroku[web.1]:停止使用SIGTERM的所有进程
2016-12-18T02:32:43.362607+00:00 heroku[web.1]:空转
2016-12-18T02:32:43.362607+00:00 heroku[web.1]:状态由上变下
2016-12-18T02:32:44.038208+00:00应用程序[web.1]:-优雅地停止,等待请求完成
2016-12-18T02:32:44.038778+00:00应用程序[web.1]:-再见!
2016-12-18T02:32:44.038774+00:00应用程序[web.1]:===puma关机:2016-12-18 02:32:44+0000===
2016-12-18T02:32:44.039352+00:00应用程序[网站1]:退出
2016-12-18T02:32:44.259020+00:00 heroku[web.1]:进程已退出,状态为0
2016-12-18T09:45:45.086929+00:00 heroku[web.1]:状态从“向下”更改为“开始”
2016-12-18T09:45:44.933284+00:00应用程序[api]:按用户设置密钥和基本配置变量XXX@gmail.com
2016-12-18T09:45:44.933284+00:00应用程序[api]:由用户创建的版本v12XXX@gmail.com

通过从
.gitignore
中删除
config/secrets.yml
修复了此问题,它实际上是在重新启动时发生的第一件事。这就是为什么它说
状态从“向下”更改为“开始”
。我想我从来没有手动设置过
SECRET\u KEY\u BASE
——Heroku在检测到您推送了rails应用程序时,会设置这个以及其他一些环境变量。也许对你有帮助