请耐心等待,因为我是一个极端的新手,不太清楚我在说什么。
我正在尝试设置一个 Git 接收后挂钩来部署我的 Jekyll 站点,如此处所述。它的内容是
#!/usr/bin/env sh
GIT_REPO=$HOME/git/jekyll.git
TMP_GIT_CLONE=$HOME/tmp/jekyll
PUBLIC_WWW=$HOME/public_html
echo $PATH
git clone $GIT_REPO $TMP_GIT_CLONE
cd $TMP_GIT_CLONE
echo "Run jekyll"
jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
cd $HOME
echo "Remove temporary dir..."
rm -Rf $TMP_GIT_CLONE
echo "Temporary dir removed."
exit
我正在呼应PATH
故障排除的目的。如果我通过 ssh 登录并使用 手动执行脚本~/git/jekyll.git/hooks/post-receive
,一切正常,控制台显示
remote$ ~/git/jekyll.git/hooks/post-receive
/usr/local/jdk/bin:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194/bin:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194@global/bin:/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin:/home7/contenw6/.rvm/bin:/usr/local/jdk/bin:/home7/contenw6/perl5/bin:/usr/lib64/qt-3.3/bin:/home7/contenw6/perl5/bin:/ramdisk/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home7/contenw6/ruby/gems/bin:/home7/contenw6/bin:/usr/local/bin:/usr/X11R6/bin:/home7/contenw6/ruby/gems/bin:/home7/contenw6/.rvm/bin
Cloning into '/home7/contenw6/tmp/jekyll'...
done.
Run jekyll
Configuration from /home7/contenw6/tmp/jekyll/_config.yml
Building site: /home7/contenw6/tmp/jekyll -> /home7/contenw6/public_html
Successfully generated site: /home7/contenw6/tmp/jekyll -> /home7/contenw6/public_html
Remove temporary dir...
Temporary dir removed.
但是,当我git push deploy master
使用笔记本电脑时,我收到此错误:
laptop$ git push deploy master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 305 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: /usr/libexec/git-core:/usr/local/jdk/bin:/ramdisk/bin:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/home7/contenw6/ruby/gems/bin:/home7/contenw6/.rvm/bin:/home7/contenw6/.rvm/bin
remote: Cloning into '/home7/contenw6/tmp/jekyll'...
remote: done.
remote: Run jekyll
remote: /home7/contenw6/ruby/gems/gems/yajl-ruby-1.1.0/lib/yajl/yajl.so: [BUG] Segmentation fault
remote: ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2012.02
remote:
remote: hooks/post-receive: line 14: 30293 Aborted jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
remote: Remove temporary dir...
remote: Temporary dir removed.
To contenw6@contentioninvain.com:~/git/jekyll.git
154f467..80c8fcb master -> master
在我看来,当由于post-receive
执行钩子时git push
,正在使用错误的红宝石(1.8.7,大概是系统的?)。请注意,PATH
每个实例中的变量都不同。
如果这就是问题所在,那就是我能想到的。我该如何解决?