I got a new computer last week. It’s the latest macbook retina, and I needed to refresh because I wanted a bigger SSD drive (and after having an SSD drive, I’ll never go back)
Anyway, I’m trying to get my Octopress blog going again, and oh my God, what a nightmare. Octopress was working beautifully for me for years, and then all of the sudden I am at the edge of Ruby Dependency Hell staring at an Octopress giving me eight fingers.
With the help of Docker, I’ve managed to tame this eight legged beast, barely.
Run Docker
See Installing Docker for instructions.
This blog post assumes you already have an Octopress git repo. If you are starting from scratch, then check out Octopress Setup Part I to become even more confused.
Install Octopress Docker image
1
|
|
After this point, the rest of the instructions assume that you are executing commands from inside the Docker Container.
Delete Octopress dir + clone your Octopress repo
The Docker container will contain an Octopress directory, but it’s not needed.
From within the container:
1 2 3 4 |
|
Now, switch to the source branch (which contains the content)
1
|
|
Re-install dependencies:
1
|
|
Prevent ASCII encoding errors:
1
|
|
Clone deploy directory
1
|
|
Rake preview
As a smoke test, run:
1
|
|
NOTE: I have no idea why bundle exec
is required here, I just used this in response to a previous error message and it’s accompanying suggestion.
If this gives no errors, that’s a good sign.
Create a new blog post
1
|
|
It will tell you the path to the blog post. Now open the file in your favorite editor and add contect.
Push to Source branch
The source branch has the source markdown content. It’s actually the most important thing to preserve, because the HTML can always be regnerated from it.
1
|
|
Deploy to Master branch
The master branch contains the rendered HTML content. Here’s how to push it up to your github pages repo (remember, in an earlier step you cloned your github pages repo at https://github.com/your-github-username/your-github-username.github.io.git)
1
|
|
After the above command, the changes should be visible on your github pages blog (eg, your-username.github.io)
Common errors
If you get:
1
|
|
Run:
1
|
|