Octopress
From charlesreid1
Some notes on setting up Octopress to work with GitHub pages.
You, too, can have a glamorous GitHub page like mine! http://charlesreid1.github.io/
Setting Up Octopress with Personal GitHub Page
A user can create a repository to host static pages that are available at http://username.github.io. These pages can be set up to use Octopress, a slick blogging platform that uses Ruby and Jekyll underneath the hood.
You can create an Octopress blog that's available at http://username.github.io. Here's how I created mine.
First of all, I wanted to be able to blog with Octopress from my netbook or from my Macbook. I found a fantastic guide that described how to do this. I'll repeat my procedure here, again, mainly because this is all for my own notes, so I remember what I did.
Create Your Repo
You first have to create a git repository with the name username.github.io. I'll just use my own username charlesreid1 from this point on. Call me vain, but you know, these are just notes for myself anyway.
So now I have a repo named "charlesreid1.github.io".
What I'm gonna do is use some Ruby code (specifically, Octopress (and Jekyll, on top of which Octopress runs)) to dump out a bunch of CSS stylesheets and HTML files that contain a nice, pretty blog. All of the static content will have been generated from a pile of markdown files that contain a simple header and then a bunch of markdown text.
Get rbenv
There are a lot of different versions of ruby out there. Various versions have various uses, but this leads to some version confusion. What we'll do is use a program called rbenv (ruby environment - get it?) to manage our ruby installation and its corresponding gems (gems are like ruby packages).
OS X
To install this on OS X, I used Homebrew:
brew update brew install rbenv brew install ruby-build
Linux
I wanted to install this on my Netbook running Ubuntu 12.04. I read that Ruby 1.9 had some serious flaws (just hearsay), so I'm using 2.0, specifically ruby 2.0.0p247. That means YOU CANNOT USE THE rbenv AND ruby-build IN THE APTITUDE REPOSITORIES!
You need the bleeding edge stuff. Here's how I installed that:
First, I installed rbenv from sstephenson on GitHub:
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc
When you start a new shell, you should be able to type
type rbenv
and see:
rbenv is a function
rbenv ()
{
[...]
YAAAYYYY!!!
Next, install ruby-build from sstephenson,
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
And now you should be able to use ruby-build to access various Ruby builds, which you can install and manage with rbenv.
Installing Ruby 2.0
Now all that's left is to install Ruby 2.0 using rbenv:
rbenv install 2.0.0-p247
This will take a while. If it looks unresponsive, just pop open another tab and run "top". You'll see either the C compiler or a ruby process cranking away on the CPU until its done.
Once you've installed your version, you gotta pick which version is going to be your main ruby version.
First, see if there's already a ruby (maybe a system ruby? old crusty ruby? who knows):
which ruby ruby --version