您必须在应用程序的配置错误中设置config.secret_key_base

时间:2014-08-17 18:24:09

标签: ruby-on-rails ruby heroku

我之前已经问过这个问题,但我已经尝试了其他答案提要中建议的所有解决方案。

我的config / initializers / secret_token.rb文件包含以下内容:

secret = Rails.env.production? ? ENV['SECRET_TOKEN'] : "top_secret_token"
SampleApp::Application.config.secret_key_base = secret

我跑了:

heroku config:set SECRET_TOKEN=e6b2d0e35664326d2a...
然后我跑了:

heroku open 

并收到此错误:

You must set config.secret_key_base in your app's config.

这是我的.gitignore文件:

# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
#   git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

# Ignore other unneeded files.
database.yml
doc/
*.swp
*~
.project
.DS_Store 
.idea
.secret

1 个答案:

答案 0 :(得分:-1)

您是否已将config/initializers/secret_token.rb添加到存储库并将其推送到heroku?