我無法運行後收到鉤如下:混帳後收到鉤不運行包安裝
#!/bin/sh
unset $(git rev-parse --local-env-vars)
cd ~/commodity
git pull origin master
bundle install
bundle exec rake assets:precompile
thin restart
我從本地推到遠程和我收到此錯誤:
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 319 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: From /var/www/html/test
remote: * branch master -> FETCH_HEAD
remote: Updating a06129c..c3c3da3
remote: hooks/post-receive: line 19: bundle: command not found
remote: hooks/post-receive: line 20: bundle: command not found
remote: hooks/post-receive: line 21: thin: command not found
error: cannot run hooks/post-receive: No such file or directory
當我在服務器上克隆我的存儲庫並推送時,鉤子運行並且一切都很好。 任何想法爲什麼推從我的本地機器推動時不會觸發捆綁命令?
謝謝!
在服務器上克隆時,您使用的是文件系統還是SSH路徑?這可能與您的SSH用戶獲得$ PATH有關。也許可以在'post-receive'中嘗試'echo $ PATH'並將它與shell中看到的'echo $ PATH'進行比較。 –
嗨,本,我克隆的文件路徑,而不是SSH。我嘗試使用SSH進行克隆,現在它在服務器上斷開。這裏是我的$ PATH:/ usr/libexec/git-core:/ usr/local/sbin:/ usr/local/bin:/ sbin:/ bin:/ usr/sbin:/ usr/bin – pudding
你的'bundle'和那個路徑中的「瘦」二進制文件?在SSH路徑中切換到用戶,例如對於git @ hostname:repo.git,執行'su git'。該用戶可以看到'bundle'和'thin'命令嗎?當你嘗試運行它們時會發生什麼?如果需要的話,修改後接收腳本中的'PATH',以便可以找到命令,例如'PATH = $ PATH:/ path/to/bundle' –