2016-09-25 31 views
1

我的〜/ .profile文件的第一行是:設計SECRET_KEY沒有設置,即使它存在於配置文件

export DEVISE_TOKEN_AUTH_SECRET_KEY="secrethere" 

當我在我的部署帳戶,回聲$ DEVISE_TOKEN_AUTH_SECRET_KEY SSH連接正常打印密鑰。但是,運行

cap production deploy 

,當我得到

Devise.secret_key was not set 

任何想法,爲什麼?

回答

2

Capistrano將其連接爲非登錄非交互式shell。它不會自動評估各種家庭腳本。

Capistrano的如何使其連接說明如下:http://capistranorb.com/documentation/advanced-features/ptys/

上的各種外殼模式進行評估哪些文件被描述如下: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可能工作。

相關問題