簡體   English   中英

如何使用 git hook post-receive 中的特定 rvm gemset 進行捆綁安裝?

[英]How to do bundle install using specific rvm gemset from git hook post-receive?

所以,我試圖在不使用 capistrano 的情況下實現類似 heroku 的部署。 要檢查和安裝 gem,我正在嘗試使用 git 掛鈎並將以下命令放入 /hooks/post-receive:

bundle check || bundle install

但是當我運行git push我得到:

remote: hooks/post-receive: line 20: bundle: command not found. 

我知道鈎子可能會從錯誤的環境中啟動命令,並且我必須以某種方式從鈎子中切換 rvm 環境。 我嘗試在 post-receive 中使用 rvm use 1.8.7@rails3 但它沒有幫助。 有任何想法嗎?

您可能只需要確保在鈎子頂部獲取用戶環境,例如:

$ source $HOME/.bash_profile # single user RVM setup
$ source /etc/profile        # multi user RVM setup

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM