惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
小众软件
小众软件
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
Last Week in AI
Last Week in AI
博客园_首页
I
InfoQ
T
Tailwind CSS Blog
爱范儿
爱范儿
雷峰网
雷峰网
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
V
Visual Studio Blog
有赞技术团队
有赞技术团队
P
Proofpoint News Feed

Hopefully Useful

macOS Needs Its Grid Back About Me Air Con: $1697 for an on/off switch The Future Called 30 Years Ago I Couldnt Wait for the New Mac Pro Ios App Promo Video on a Budget
Jekyll and Octopress
2013-07-21 · via Hopefully Useful

So I’ve decided I should probably blog about things in my life that other people might find interesting. I’ve decided this mainly because I’ve noticed that the longer I live in Japan the worse my English skills become. It could just be a case of getting older but I find myself often struggling for words or expressions that I’m sure used to come to me with ease. Since my Japanese is not getting proportionally better I should probably do something to stem the tide. Consider this, my umpteenth attempt at actually blogging that something.

Anyway I have decided to try out this Jekyll markdown based static blog generator. I subsequently chose Octopress because it came with a theme and bunch of instructions I actually found comprehensible.

The reason for using markdown is simple. I would like to keep any blog posts I actually do make readable as text files on my local computer. Although I know its syntax and general conventions, I’ve not actually used it for anything of note and this seems like a good first project.

Smoothish Sailing

Apparently Octopress needs a specific version of Ruby. 1.9.3 and the instructions on the website detailed how to get a program called rbenv to manage multiple versions. I’m completely ignorant to all things ruby so I must admit to being really surprised at this. Why isn’t simply the latest stable version the best choice?

Anyway after installing rbenv I tried to install the recommended version:

MacPro:~ christian$ rbenv install 1.9.3-p0

ERROR: This package must be compiled with GCC, but ruby-build couldn't
find a suitable `gcc` executable on your system. Please install GCC
and try again.

DETAILS: Apple no longer includes the official GCC compiler with Xcode
as of version 4.2. Instead, the `gcc` executable is a symlink to
`llvm-gcc`, a modified version of GCC which outputs LLVM bytecode.

For most programs the `llvm-gcc` compiler works fine. However,
versions of Ruby older than 1.9.3-p125 are incompatible with
`llvm-gcc`. To build older versions of Ruby you must have the official
GCC compiler installed on your system.

It then detailed how to download the latest version of GCC but I instead decided just to install what looked like the most recent version of 1.9.3

MacPro:~ christian$ rbenv install 1.9.3-p327
Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/christian/.rbenv/versions/1.9.3-p327
...success ensued

I thought I was home clear at this point but…

MacPro:Blog christian$ cd octopress/
MacPro:octopress christian$ ruby --version
rbenv: version `1.9.3-p194' is not installed
MacPro:octopress christian$ rbenv install 1.9.3-p194
Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/christian/.rbenv/versions/1.9.3-p194
...Success 2.0 ensued

Apparently the version is very specific. I’m sure all of this could have been avoided by anyone with a lick of ruby or yaml experience but I am a complete newbie with both.

Seems pretty good.

Teething problems aside, I quite like the workflow around this system. I edit a post inside the source/_posts directory with a name of YYYY-MM-DD-titleofpost.markdown and in a terminal I have simply entered the following:

MacPro:octopress christian$ rake preview
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000
Configuration from /Users/christian/Dropbox/HUS/Projects/Blog/octopress/_config.yml
[2013-07-21 19:59:20] INFO  WEBrick 1.3.1
[2013-07-21 19:59:20] INFO  ruby 1.9.3 (2012-04-20) [x86_64-darwin12.4.0]
[2013-07-21 19:59:20] INFO  WEBrick::HTTPServer#start: pid=77031 port=4000
Auto-regenerating enabled: source -> public
[2013-07-21 19:59:20] regeneration: 94 files changed
>>> Compass is watching for changes. Press Ctrl-C to Stop.

Anytime I make a change this preview server notices it and regenerates. I’ve got plenty of my own hosting so I’ll most likely be following Octopress’ rsync deployment instructions. If this post is actually online then I guess it worked.