- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我已经生成了简单的 Rails API 应用程序,但我遇到了 Rails.application.secrets.secret_key_base
的问题 - 它是 nil
。我在我的本地机器上启动它。根据this article一切都应该没问题。我有正确的 app/config/credentials.yml.enc
。当我尝试使用 rails credentials:edit
编辑它时,它会正确编辑。实际内容是
# Used as the base secret for all MessageVerifiers in Rails, including the one protecting cookies.
secret_key_base: 47ba27802a354b44c1cd0d0c624fcde2dced69ccfe62d274e9ecfc98d9e6671c4cf31a29aaf77af555d9553811a3ff15f22ab060e5ec5ffc0d29f77241368272
在所有配置文件 (/app/config/environments/*.rb
) 中,我添加了 config.require_master_key = true
- 它没有帮助。我的实际 Rails.application.secrets
内容是 {:secret_key_base=>nil, :secret_token=>nil}
。我已将它转储到我的自定义类和 application_controller.rb
- 这两个地方的结果相同。
有什么我遗漏的想法吗?
附言。在您用重复标记此问题之前 - 请注意,我使用的是 rails 5.2,其中凭据存储已更改。
最佳答案
尝试
Rails.application.credentials.secret_key_base
secret_base_key
不同于 credentials
当您将 secret_base_key
添加到凭据时,它仅可用作凭据而不是 secret 。
关于ruby - 测试环境中 Rails.application.secrets 中缺少 secret_key_base,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52220562/
我有 ubuntu 服务器、Rails 5.0 和 apache web 服务器 我也有很多网站 添加新站点时,出现错误“从应用程序收到不完整的响应” 当我检查 apache 日志时,我看到消息: A
我的 nginx error.log 中有错误 Missing 'secret_key_base' for 'production' environment。当我打开 secrets.yml 时,我看
我最近部署了一个应用程序,但由于缺少生产 secret_key_base 而出现内部服务器错误。经过数小时的测试,我设法用两种方法解决了这个问题: 方法一: 我用 rake secret 生成了一个新
我不明白为什么找不到我的 secret_key_base。当我在生产中启动我的应用程序时,我在 Web 浏览器上收到此消息:Missing 'secret_key_base' for 'product
我刚刚转而使用 Figaro gem v1.0.0 和 Rails 4.1.6。由于删除了我的 secrets.yml 文件,我现在收到错误: 处理请求时出现意外错误:缺少 secret_key_ba
所以我正在尝试在生产环境中部署我的 Rails 应用程序。当我转到该页面时,出现 500 错误。当我转到我的错误日志时,我收到以下错误: Exception RuntimeError in Rack
我在生产环境中的根文件夹中有一个 .env 文件。此文件定义 SECRET_KEY_BASE,用于 config/secrets.yml。问题是我无法在 config/secrets.yml 之前加载
我的 Phoenix 应用程序中出现以下错误: cookie store expects conn.secret_key_base to be set 它似乎来自 |> redirect(to: se
我有一个 Rails 应用程序,我想在云和本地的生产环境中运行它。这是为了使其可以离线工作。为此,我将本地数据库与云上的数据库同步。然后它们是相同的。 然后我当然会在本地计算机和云端安装该应用程序。
Rails 4 在 config/secrets.yml 中声明常量 secret_key_base 用于“验证签名 cookie 的完整性”。论文长度为 128 个字符 (0..f)。 Paperc
据我所知,secret_key_base 仅用于对 cookie 进行签名,更改 secret_key_base 会导致现有 cookie 失效。我需要在生产中更改 secret_key_base,让
我正在尝试使用 AWS EB CLI 在生产环境中启动我的 Rails 6.0.2.1、Ruby 2.6.5 应用程序,但是,我仍然遇到这个问题。为此,我尝试了 Google 搜索结果前两页中存在的所
我正在尝试使用 AWS EB CLI 在生产环境中启动我的 Rails 6.0.2.1、Ruby 2.6.5 应用程序,但是,我仍然遇到这个问题。为此,我尝试了 Google 搜索结果前两页中存在的所
我正在尝试访问我的本地主机,但我的浏览器中不断出现以下错误: You must set config.secret_key_base in your app's config 我环顾四周,有人说你必须
我看到了这个解决方案的所有答案,但对我没有用。 1 - 我的配置部署等于这个 tutorial by DigitalOcean (Capistrano 3 、Nginx 和 Puma),部署成功后,我
因此,我正在将一个运行在 Apache 和 Phusion Passenger 上的 Rails 4 应用程序部署到 DigitalOcean 上托管的 Ubuntu droplet。部署后,由于 R
我已经生成了简单的 Rails API 应用程序,但我遇到了 Rails.application.secrets.secret_key_base 的问题 - 它是 nil。我在我的本地机器上启动它。根
在Rails 4 In Action Book ,它指出在进行了一些其他设置之后:在生产模式(使用 web brick)中启动 Rails 应用程序的最终设置是在终端中输入此命令: SECRET_KE
我从头开始创建了一个 Rails 应用程序 (Rails 4.1.0),但我遇到了一个我无法解决的问题。我已经安装并配置了 Apache 乘客模块,它工作正常。每当我尝试访问虚拟主机时,我都会收到错误
在 Rails 4.x 中 secret_key_base用于对 session cookie 以及通过调用 cookies.signed 创建的任何其他签名 cookie 进行签名。 . 我想更新/
我是一名优秀的程序员,十分优秀!