我在我的服務器上進行這樣的:Rails:發生未處理的低級別錯誤。應用程序日誌可能有詳細信息
[email protected]:~/applications/spa_backend/current$ bundle exec rake secret
4b921910**
[email protected]:~/applications/spa_backend/current$ export SECRET_KEY_BASE=4b921910**
[email protected]:~/applications/spa_backend/current$ irb
irb(main):001:0> ENV["SECRET_KEY_BASE"]
=> "4b921910**"
當我試圖用我的應用程序中打開鏈接,我看到:
An unhandled lowlevel error occurred. The application logs may have details.
puma_error.log:
#<RuntimeError: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`>
/home/deploy/applications/spa_backend/shared/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:513:in `validate_secret_key_config!'
/home/deploy/applications/spa_backend/shared/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:246:in `env_config'
secrets.yml:
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
UPD。我改變<%= ENV["secret_key_base"] %>
- ><%= ENV["SECRET_KEY_BASE"] %>
,但它並沒有幫助
不要這樣做。出於某種原因,祕密不應該添加到版本控制中。 –