ruby-on-rails–git post-receive hook没有运行bundle install

ruby-on-rails–git post-receive hook没有运行bundle install,第1张

概述我无法运行post-receive hook,如下所示:#!/bin/sh unset $(git rev-parse --local-env-vars) cd ~/commodity git pull origin master bundle install bundle exec rake assets:precompile thin restart 我

我无法运行post-receive hook,如下所示:

#!/bin/shunset $(git rev-parse --local-env-vars)cd ~/commoditygit pull origin masterbundle installbundle exec rake assets:precompilethin 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/testremote:  * branch            master     -> FETCH_headremote: Updating a06129c..c3c3da3remote: hooks/post-receive: line 19: bundle: command not foundremote: hooks/post-receive: line 20: bundle: command not foundremote: hooks/post-receive: line 21: thin: command not founderror: cannot run hooks/post-receive: No such file or directory

当我在服务器上克隆我的存储库并推送时,钩子运行并且一切都很好.
任何想法为什么推送从我的本地机器推送时不会触发捆绑命令?

谢谢!

最佳答案尝试将此行添加到您的post-receive挂钩(至少在您的第一个捆绑…呼叫之前):

[[-s“$HOME / .rvm / scripts / rvm”]]&&源“$HOME / .rvm / scripts / rvm”

在Unix系统上,rvm会自动将此行添加到〜/ .bash_profile中.在任何非bash上下文(crontab,git hooks)中,你必须手动添加它.

总结

以上是内存溢出为你收集整理的ruby-on-rails – git post-receive hook没有运行bundle install全部内容,希望文章能够帮你解决ruby-on-rails – git post-receive hook没有运行bundle install所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1050380.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存