设计秘密钥匙未设定 [英] Devise Secret Key was not set

查看:132
本文介绍了设计秘密钥匙未设定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Active Admin gem开发一个Rails 4应用程序,用于管理后端。 Active Admin依次使用Devise进行用户身份验证。现在,当我尝试在VPS服务器上使用 capistrano 部署应用程序时,我得到以下错误:

I am developing a Rails 4 app using the Active Admin gem for the administration back end. Active Admin in turn uses Devise for user authentication. Now, when I try to deploy the app using capistrano on the VPS server, I get the below error:

rake aborted!
Devise.secret_key was not set. Please add the following to your Devise initializer:
config.secret_key = '-- secret key --'

Google搜索对此错误没有太大影响。任何建议为什么会引发错误?我应该将密钥添加到 devise 初始化器,因为我找不到任何地方在 initializers / devise.rb

A Google search does not do much for this error. Any suggestions why it is throwing an error? Should I add the secret key to devise initializer, as I cannot find any place to set such config key in initializers/devise.rb?

推荐答案

我今天早上运行了一个软件包更新,并开始得到相同的错误。

I ran a bundle update this morning and started getting the same error.

我将其添加为 config / initializers / devise.rb 中的一行,并且错误已解决。

I added it as a line in config/initializers/devise.rb and the error is resolved.

这似乎是介绍它的提交 - https:/ /github.com/plataformatec/devise/commit/d56641f514f54da04f778b2a9b816561df7910c2

This seems to be the commit which introduced it - https://github.com/plataformatec/devise/commit/d56641f514f54da04f778b2a9b816561df7910c2

这篇关于设计秘密钥匙未设定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆