Sunday, July 7, 2013

Installing Octopress

I have installed Octopress (blogging framework) on my Xbuntu.

1. Resources

Octopress home page:
The Hiltomon: "18 Months of Octopress"

2. Installation

$ git clone git:// octopress
Cloning into 'octopress'...
remote: Counting objects: 10374, done.
remote: Compressing objects: 100% (4486/4486), done.
remote: Total 10374 (delta 5726), reused 9440 (delta 5036)
Receiving objects: 100% (10374/10374), 2.30 MiB | 1.28 MiB/s, done.
Resolving deltas: 100% (5726/5726), done.

$ cd octopress

$ ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

$ sudo gem install bundler
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5
1 gem installed
Installing ri documentation for bundler-1.3.5...
Installing RDoc documentation for bundler-1.3.5...

$ bundle install
Fetching gem metadata from
Fetching gem metadata from
Resolving dependencies...
Using rake ( 
Installing RedCloth (4.2.9) 
Installing chunky_png (1.2.5) 
Installing fast-stemmer (1.0.1) 
Installing classifier (1.3.3) 
Installing fssm (0.2.9) 
Installing sass (3.2.9) 
Installing compass (0.12.2) 
Installing directory_watcher (1.4.1) 
Installing haml (3.1.7) 
Installing kramdown (0.13.8) 
Installing liquid (2.3.0) 
Installing syntax (1.0.0) 
Installing maruku (0.6.1) 
Installing posix-spawn (0.3.6) 
Installing yajl-ruby (1.1.0) 
Installing pygments.rb (0.3.4) 
Installing jekyll (0.12.0) 
Installing rack (1.5.2) 
Installing rack-protection (1.5.0) 
Installing rb-fsevent (0.9.1) 
Installing rdiscount ( 
Installing rubypants (0.2.0) 
Installing sass-globbing (1.0.0) 
Installing tilt (1.3.7) 
Installing sinatra (1.4.2) 
Installing stringex (1.4.0) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

$ rake install
## Copying classic theme into ./source and ./sass
mkdir -p source
cp -r .themes/classic/source/. source
mkdir -p sass
cp -r .themes/classic/sass/. sass
mkdir -p source/_posts
mkdir -p public

3. Installation Directory

4. Deployment on Heroku
Required to have a Heroku account. (
$ wget -qO- | sh
$ heroku create
Git remote heroku added
$ leafpad .gitignore  # edit to remove line 'public'
$ rake generate
## Generating Site with Jekyll
$ git add .
$ git commit -m 'site updated'
$ git push heroku master
$ git commit -m 'new title'
# On branch master
# Changes not staged for commit:
#   (use "git add ..." to update what will be committed)
#   (use "git checkout -- ..." to discard changes in working directory)
# modified:   _config.yml
no changes added to commit (use "git add" and/or "git commit -a")
$ git add _config.yml
$ git commit -m 'config change: new title'
$ git push heroku master

$ rake preview
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000

$ heroku open
Opening myapp... done

5. Some notes
After the deployment, I had to make a change to _config.yml. However, it did not update my site with:
$ git add _config.yml
$ git commit -m 'config changed'
$ git push heroku master
I had to add "all".
$ git add .
$ git commit -m 'config changed'
$ git push heroku master
Then and only then, it update my site with the latest changes to my _config.ym.

1 comment:

  1. Thanks Socrateos. This is just the cheatsheet I needed to remember some commands I had forgotten about deploying Octopress on Heroku.