Blog

A simple blog.

Installing Octopress

I (rather obviously) recently found myself attempting to install Octopress. Sure, it has great documentation, but some areas were lacking – specifically, initial setup. As someone who has not worked with Ruby before other than a rather limited Windows install for a jekyll project, I had virtually no experience installing Ruby, using RVM, or even playing with RubyGems.

After a couple of hours of trial and error (and Google-searching), I managed to get Octopress running on my local machine. I then proceeded to duplicate my steps on my other dev machine; wonder of wonders, it became a simple five-minute process once I knew what to do.

As I stated earlier, the Octopress documentation doesn’t cover everything, so I figured I’d go over my install process in more detail here to help you get started with Octopress and its underlying technologies.

Prerequisites

According to the RVM guide, you need a few prerequisites to install Ruby:

1
2
sudo apt-get install bash curl git-core
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake

Feel free to disregard some of the packages in the second command if you know better; I haven’t verified whether all of them are absolutely necessary.

Also, a quick disclaimer: I am by no means an expert in this. This is the tale of one man’s successful fight to install Octopress, and as such, I cannot address all of the variants of installations. I’m not using Github Pages, so I won’t specifically address that (the Octopress guide goes over Github Pages integration with much detail). My two installs both used Ubuntu-derived distributions, so I’m guessing these instructions will mostly work for Debian-based systems. No guarantees beyond that. I installed RVM for single-user use; system-wide installation instructions can be found in the RVM guide if you need them.

Installing RVM

RVM is the Ruby Version Manager. It handles the installation and management of multiple Ruby environments, and Octopress was created specifically to be installed into an RVM-controlled environment.

Start off with this command to install single-user RVM (for system-wide installation instructions, see the RVM guide):

1
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

Once RVM is installed, tell bash to use it (you only need to do this once):

1
2
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source .bash_profile

To check that it is properly installed, run one (or both) of these commands:

1
2
3
4
type rvm | head -1
# expected: rvm is a function
which rvm
# expected: /home/[USERNAME]/.rvm/bin/rvm

Installing OpenSSL & iconv

Now that you’ve installed RVM, you should use it to install the OpenSSL & iconv packages. They are used within Octopress, so they must be installed and correctly integrated with Ruby.

Run these commands to install the two:

1
2
rvm pkg install openssl
rvm pkg install iconv

Installing Ruby

This step is the meat of the process. You must install version 1.9.2 of Ruby. It may take a while to download and install, but after it has finished, you will have a fresh copy of the newest Ruby release installed into RVM.

1
rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr

Once Ruby is installed, ensure RVM has also installed the latest RubyGems:

1
rvm rubygems latest

Finally, tell RVM to use 1.9.2 as the default Ruby and install the Bundler dependency manager:

1
2
3
rvm use 1.9.2 --default
rvm reload
gem install bundler

Getting Started With Octopress

Now that you have the system all configured, you’re almost all ready to begin the Octopress setup. Simply change directories to a suitable location for your site repository and then follow the instructions on the Octopress Setup Page. The Octopress docs should be able to answer pretty much any further questions you have about installing, configuring, or blogging with Octopress; they are quite extensive.

I hope this simple guide was helpful. If you have any questions or comments, let me know! Shoot me an email at nick@aldwin.us or post in the comments below (assuming I’ve gotten Disqus to work). Thanks for stopping by.

Comments