Hello Octopress

Octopress:A blogging framework for hackers.

看到介绍就被吸引了,正好最近想写些东西,于是决定用Octopress来搭个自己的博客。Octopress既然是为黑客准备的,有点难度那也是很正常的。网上很多都是介绍搭建的博客的步骤,但对出现各种问题以及解决办法的总结不是很多。而自己和ruby不是好朋友,过程中出现很多的问题,这里把遇到的问题贴上来,一来做个总结;二来也可以给遇到同样的问题的朋友一些帮助。

1. An error occurred while installing RedCloth (4.2.9), and Bundler cannot continue.

1
2
An error occurred while installing RedCloth (4.2.9), and Bundler cannot continue.
Make sure that gem install RedCloth -v '4.2.9' succeeds before bundling.

Solution:

1
$ sudo gem install RedCloth -v '4.2.9' --verbose

2. You have already activated rake 10.1.0, but your Gemfile requires rake 10.0.4.

1
2
3
4
rake aborted!
You have already activated rake 10.1.0, but your Gemfile requires rake 10.0.4. Prepending `bundle exec` to your command may solve this.
/Users/dongmeiliang/Documents/octopress/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)

Solution:这个问题可以每次加上bundle exec,但是总有一种不舒坦的感觉,找了很久找到一点线索,最后用下面办法解决了:

1
2
3
4
5
6
7
brew update
brew doctor
cd root_path_octopress
git pull octopress master
rm Gemfile.lock
vim Gemfile
gem 'rake', '~> 10.1.0'//改成合适的版本
继续阅读