hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.54k stars 4.86k forks source link

hexo 无法部署 gitcafe 等其他 git 在线服务 #977

Closed yujiangshui closed 9 years ago

yujiangshui commented 9 years ago

在部署 gitcafe 时出错,主要用网上常说的两种方法:

1,用 github + branch

配置:

deploy:
  type: github
  repo: https://gitcafe.com/yujiangshui/hexo.git
  branch: gitcafe-pages

报错:

➜  hexo git:(master) hexo d
[info] Start deploying: github
[info] Clearing .deploy folder...
[info] Copying files from public folder...
On branch master
nothing to commit, working directory clean
error: src refspec gitcafe-pages does not match any.
error: failed to push some refs to 'https://gitcafe.com/yujiangshui/hexo.git'
[info] Deploy done: github

2,用多个 git 配置

配置:

deploy:
  type: git
  message: [message]
  repo:
    github: https://github.com/yujiangshui/hexo.git,gh-pages
    gitcafe: https://gitcafe.com/yujiangshui/hexo.git,gitcafe-pages

报错:

➜  hexo git:(master) ✗ hexo d
[info] Start deploying: git
[info] Clearing .deploy folder...
[info] Copying files from public folder...
[error] TypeError: Object [object Array] has no method 'replace'
TypeError: Object [object Array] has no method 'replace'
    at Object.exports.parse (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/parser.js:437:19)
    at parse (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/swig.js:343:19)
    at Object.precompile (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/swig.js:473:23)
    at Object.compile (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/swig.js:588:16)
    at exports.commitMessage (/usr/local/lib/node_modules/hexo/lib/plugins/deployer/util.js:17:15)
    at /usr/local/lib/node_modules/hexo/lib/plugins/deployer/git.js:107:26
    at /usr/local/lib/node_modules/hexo/node_modules/async/lib/async.js:610:21
    at /usr/local/lib/node_modules/hexo/node_modules/async/lib/async.js:249:17
    at iterate (/usr/local/lib/node_modules/hexo/node_modules/async/lib/async.js:149:13)
    at /usr/local/lib/node_modules/hexo/node_modules/async/lib/async.js:160:25
cocobear commented 9 years ago

试了几种_config.yml的配置方式,我使用的hexo(2.8.3)版本只有下面这种方式是两个服务器都可以成功push的:

deploy:
    type: github
    repo: https://github.com/cocobear/cocobear.github.io.git
    type: github
    repo: https://gitcafe.com/cocobear/cocobear.git
    branch: gitcafe-pages
lluvio commented 9 years ago

然后记得把.depley文件删掉

dowhilenet commented 9 years ago

我也遇到了和你一样的第二个问题,请问你是怎么解决的?

yujiangshui commented 9 years ago

@dowhilenet 最后我不部署了,买了个香港虚拟主机,写了个 PHP 部署脚本同步 hexo 博客。这样速度超快的。

dowhilenet commented 9 years ago

虚拟主机贵吗?

发自我的 iPhone

在 2015年3月4日,下午10:32,JiangShui Yu notifications@github.com 写道:

@dowhilenet 最后我不部署了,买了个香港虚拟主机,写了个 PHP 部署脚本同步 hexo 博客。这样速度超快的。

— Reply to this email directly or view it on GitHub.

yujiangshui commented 9 years ago

300 两年。很便宜。

dowhilenet commented 9 years ago

可以给我推荐一下吗?

发自我的 iPhone

在 2015年3月5日,下午11:04,JiangShui Yu notifications@github.com 写道:

300 两年。很便宜。

— Reply to this email directly or view it on GitHub.

yujiangshui commented 9 years ago

@dowhilenet 衡天主机