按照教程来,安装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
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.