我就是无法忽略这个信息:
Missing `secret_key_base` for 'production' environment, set this string with `rails credentials:edit` (ArgumentError)
我使用的是Rails 5.2.0版本,并且运行了以下命令
EDITOR=vim rails credentials:edit
并且里面:
production:
secret_key_base: xxxxxxxxxxxxxxxxxxxxxxx
保存后,在终端中执行:
RAILS_ENV=production rails c
我错过了什么吗?我已经重启了服务器,但是仍然遇到相同的问题,在开发模式下没有问题。
secrets.yml
。顺便说一下,这个解决方案对我不起作用。 - zmd94config/environments
文件夹中的production.rb
中添加config.secret_key_base = 'YourSecretKeyHere'
。'YourSecretKeyHere'可以通过运行bundle exec rake secret
命令生成。 - zmd94