OctoPress Installation can seem to be difficult due to inadequate detailed guides to the users who are not used with Ruby Gems. Here is a full guide for everyone. We first talked about Jekyll and OctoPress on Free Cloud Platforms here. We are assuming that the reader is using the latest version of OS X. We will suggest to use default Terminal, instead of iTerm2 with Homebrew package manager as installation of Ruby Gems demands sudo command and Homebrew has anger with sudo. Lightly said, but from our experienced view, Terminal is better to use with default tty than zsh. You need to know lot of things for OctoPress Installation as a new user, which usually creates difficulty for a new user.
OctoPress Installation Steps : Why We Will Use and What Actually OctoPress is?
OctoPress is not a substitute for WordPress or any blogging platform. It simply uses Ruby Gems on your local computer to generate plain HTML webpages. All the latest CSS stuffs are included in the package (like SaaS), Typographically it looks great, it loads faster, possibly the SEO will be better.
As basically Jekyll was used for GitHub Pages, the default writing is in Markdown format. As basically on the webserver frontend, we are serving the HTML pages, any CDN type OpenStack Swift Storage like Rackspace Cloud Files (you are reading it right) can work as server.
---
In other words – we are simply doing what we did a decade ago with various softwares to create webpages. However, OctoPress is more flexible and advanced. The template usage makes it suitable for using as a kind of blogging software. But practically, the usage is limited to less frequently updated websites. OctoPress is not bad – it is very much suitable to certain needs, but OctoPress is not an option to make your self hosted WordPress blog flat – there are many ways to make your existing WordPress blog converted to plain HTML, preserving the HTML structure (less harmful to SEO).
So, the practical fact is – only certain CSS, Javascripts, HTML pages of the local development will be used on server.
OctoPress Installation Step by Step Guide
So, basically pushing the localhost installation means pushing the CSS, Javascripts, HTML pages of the local development. Ruby version management is usually done with RVM, it is widely used. For OctoPress we need to use rbenv. However, in the way we will write the guide, will not create any issue even if you are a RVM version management person. Although, we suggested to not use Homebrew, we will suggest to install rbenv only from iTerm2+Homebrew combo, which on this website we usually use. Here are the commands :
1 2 | brew update brew install rbenv ruby-build |
This is first and last work with iTerm2+Homebrew combo, close it and open Terminal App. Octopress comes with a default .rvmrc file (in its root directory) that is configured to use Ruby 1.9.2. Since we are using newer Ruby, we need to change the commands to avoid conflicts. Unless your only work is with OctoPress, this way is used since a long time.
So, run this command (probably you are at your usename $HOME) :
1 | git clone git://github.com/imathis/octopress.git && cd octopress |
We are in the master. Run command to install Bundler :
1 | sudo gem install bundler |
Next, rehash :
1 | sudo rbenv rehash |
If you directly run :
1 | bundle install |
It will throw errors. Normally, running with sudo :
1 | sudo bundle install |
In case, you have all dependencies installed; you will get this kind of output :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | Using rake (0.9.6) Using RedCloth (4.2.9) Using chunky_png (1.3.0) Using fast-stemmer (1.0.2) Using classifier (1.3.4) Using fssm (0.2.10) Using sass (3.2.14) Using compass (0.12.2) Using directory_watcher (1.4.1) Using haml (3.1.8) Using kramdown (0.14.2) Using liquid (2.3.0) Using maruku (0.7.1) Using posix-spawn (0.3.8) Using yajl-ruby (1.1.0) Using pygments.rb (0.3.7) Using jekyll (0.12.1) Using rack (1.5.2) Using rack-protection (1.5.2) Using rb-fsevent (0.9.4) Using rdiscount (2.0.7.3) Using rubypants (0.2.0) Using sass-globbing (1.0.0) Using tilt (1.4.1) Using sinatra (1.4.4) Using stringex (1.4.0) Using bundler (1.5.3) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. |
Obviously, we will never have older stringex (1.4.0) like packages installed, so as we are executing with sudo, they will get automatically installed.
The next thing to know is, with this kind of old dependencies and rbenv, it is a punishment to use rake
command alone. Wherever there is written to run rake dosomething
, you will run bundle exec rake dosomething
. So, in case of our OctoPress, the last command is :
1 | bundle exec rake install |
You can add sudo
in case Permission related issue is faced. That™s it for OctoPress! But how do we view it? To view it, we need to compile the html and expose that to our web server. To do this, run the following commands which will generate the html :
1 | sudo bundle exec rake generate |
Create a new Post by :
1 | bundle exec rake new_post |
It will ask “Enter a title for your post:”
You know what to do. The _config.yml is quite important file :
1 | https://raw.github.com/imathis/octopress/master/_config.yml |
You need to Edit with any Text Editor. You should read these :
1 | http://octopress.org/docs/blogging/ |
Here are some Themes :
1 | https://github.com/imathis/octopress/wiki/3rd-Party-Octopress-Themes |
So, when they are saying to run :
1 | rake install['respectMattt'] |
(Do not laugh for the name), they wanted to say :
1 | sudo bundle exec install['respectMattt'] |
You can test on your computer, it is really good; but the initial setup can be painful to many.