未设置设计密钥 [英] Devise Secret Key was not set

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

问题描述

我正在使用 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?

推荐答案

今天早上我运行 bundle update 并开始遇到同样的错误.

I ran 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 was fixed.

这似乎是引入它的 commit.

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

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