按照教程来,安装brew,然后ruby什么的,环境都搭建好了。
我创建了几篇博客用rake preview在本地也可以预览,接下来按照这样的顺序
rake setup_github_pages
rake generate
到rake generate这一步的时候报错:
Generating Site with Jekyll
write source/stylesheets/screen.css
Configuration file: /Users/hf-27/octopress/_config.yml
Source: source
Destination: public
Generating...
done.
Auto-regeneration: disabled. Use --watch to enable.
使用rake --watch,也无济于事。
网上查的时候,怀疑是jekyll的问题,因为我用jekyll build命令时出现同样的问题,错误提示一模一样。
第二个疑问是,我没理会上面的问题,继续rake deploy,出现问题,此时我只是新建的几个博客,没有用git做其他操作(add commit都没有),错误提示有两段比较重要的,其中一段是这样的:
Deploying branch to Github Pages
Pulling any updates from Github Pages
cd _deploy
warning: no common commits
remote: Counting objects: 5067, done.
remote: Compressing objects: 100% (2233/2233), done.
remote: Total 5067 (delta 2447), reused 5060 (delta 2443), pack-reused 0
Receiving objects: 100% (5067/5067), 1.38 MiB | 663.00 KiB/s, done.
Resolving deltas: 100% (2447/2447), done.
From https://github.com/kobe1941/kobe1941.github.io
* [new branch] master -> origin/master
* [new branch] source -> origin/source
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
cd -
rm -rf _deploy/index.html
Copying public to _deploy
cp -r public/. _deploy
cd _deploy
另外一段错误提示是:
Pushing generated _deploy website
To https://github.com/kobe1941/kobe1941.github.io.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/kobe1941/kobe1941.github.io.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Github Pages deploy complete
cd -
我是指想搭个博客而已嘛,求各位帮忙解决这两个问题。
我操作的branch是source。
我安装的环境的版本:
hf-27deMac-mini:octopress hf-27$ gem --version
2.4.6
hf-27deMac-mini:octopress hf-27$ bundle --version
Bundler version 1.8.3
hf-27deMac-mini:octopress hf-27$ rake --version
rake, version 10.4.2
hf-27deMac-mini:octopress hf-27$ jekyll --version
jekyll 2.5.3
1
wbbim 2015-03-07 12:51:04 +08:00 via iPhone
只是搭博客的话
Hexo Ghost Wordpress欢迎你 |
3
chloerei 2015-03-07 14:25:25 +08:00
机智的我发现了问题:
Generating... done. 哪里报错了? |
4
kobe1941 OP @chloerei 下面有一句:Auto-regeneration: disabled. Use --watch to enable.
这个disabled不是错误么 |
5
kobe1941 OP @chloerei 请问第二个问题怎么解决呢?git的分支问题,我按照教程来的额,所有创建文章和提交都在source分支
|
8
zealic 2015-03-07 16:53:59 +08:00
rake generate --watch
|
9
zealic 2015-03-07 16:54:56 +08:00 1
或者 jekyll --watch
这个只能算是警告,可以忽略 watch 只是让生成内容可以实时更新。 |
10
kobe1941 OP @zealic
@chloerei 1.我把github上的仓库删掉,重新弄了一遍,可能是之前添加ssh的时候没弄对, 2.关于第二个问题,我在这里找到了答案: http://stackoverflow.com/questions/19619280/octopress-pushing-error-to-github 现在可以使用正常了,Auto-regeneration: disabled. Use --watch to enable.这句话确实不是错误。 现在执行 rake deploy 依然会有 There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> master 这个信息提示,我没理会,不影响使用。 |
11
guoruei 2015-03-07 19:40:18 +08:00
|
12
ChiangDi 2015-03-07 21:21:47 +08:00
jekyll 本来是很简单的,几条命令就搞定了, octopress 就是要把事情弄复杂化。
|
15
kobe1941 OP @guoruei 最后一个问题(刚刚解决掉了,使用```rake deploy```指令时会提示
```There is no tracking information for the current branch. Please specify which branch you want to merge with. ``` 是因为,这个指令会把博文部署到github上仓库的master分支,它的pull和push是系统自动的,系统报这个警告,说明需要我们设置.deploy/文件下默认pull和push的分支,根据提示,执行以下指令即可: ``` cd _deploy git branch --set-upstream-to=origin/master master ``` 注意这里的分支是master,因为是部署到github给别人看的,自己写博文的分支才是source |
16
kobe1941 OP 加一句,本人博客是kobe1941.github.io
暂时没卖域名,期待跟各位共同进步。 |