我在运行接收后挂钩时遇到问题,如下所示:
#!/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
当我在服务器上克隆我的存储库并推送时,挂钩运行并且一切都很好。
有什么想法为什么从本地计算机推送时推送不会触发捆绑命令?
Thanks!
尝试将此行添加到您的 post-receive 挂钩中(至少在您的第一个bundle ...
call):
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
在 Unix 系统上,rvm 会自动将此行添加到~/.bash_profile
。在任何非 bash 上下文(crontab、git hooks)中,您必须手动添加它。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)