【问题标题】:Devise secret_key not set, even though it's present in profile设计 secret_key 未设置,即使它存在于配置文件中
【发布时间】:2023-04-07 02:00:01
【问题描述】:

我的 ~/.profile 文件的第一行是:

export DEVISE_TOKEN_AUTH_SECRET_KEY="secrethere"

当我通过 SSH 连接到我的部署者帐户时,echo $DEVISE_TOKEN_AUTH_SECRET_KEY 会正常打印密钥。但是,运行时

cap production deploy

我明白了

Devise.secret_key was not set

有什么想法吗?

【问题讨论】:

    标签: ruby-on-rails devise capistrano capistrano3


    【解决方案1】:

    Capistrano 以非登录、非交互式外壳的形式进行连接。它不会自动评估各种主脚本。

    Capistrano 如何建立连接在此处描述:http://capistranorb.com/documentation/advanced-features/ptys/

    此处描述了在各种 shell 模式下评估哪些文件:https://github.com/rbenv/rbenv/wiki/Unix-shell-initialization#bash

    这里展示了许多其他设置环境变量的方法:Capistrano: Can I set an environment variable for the whole cap session?

    这里有一个重复的问题:https://superuser.com/questions/564926/profile-is-not-loaded-when-using-ssh-ubuntu

    此问题的常见问题解答部分在这里:http://capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/

    从最后一个链接中,我们看到~/.bashrc 可能有效。

    【讨论】:

      猜你喜欢
      • 2019-08-30
      • 1970-01-01
      • 2017-04-12
      • 1970-01-01
      • 2021-09-26
      • 2020-04-26
      • 2013-10-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多