rails 4 中的弃用警告

DEPRECATION WARNING in rails 4

我的 Rails 版本是 Rails 4.0.13

我在 config/initializers/secret_token.rb 中有我的密钥,所以我不确定为什么它仍然抛出这个错误。

DEPRECATION WARNING: You didn't set config.secret_key_base. Read the upgrade documentation to learn more about this new config option

在我的 secret_token.rb 文件中,我更改了以下内容:

API::Application.config.secret_key_base = ENV['SECRET_KEY']

API::Application.config.secret_key_base = 'SECRET_KEY'

这似乎解决了我 运行 时的问题。