1. Introduction to nanoc
  2. Installation
    1. Installing Ruby
    2. Installing Rubygems
    3. Installing nanoc
  3. Getting Started
  4. Basic Concepts
  5. Advanced Concepts
  6. Guides
  7. Glossary
  8. Frequently Asked Questions
  9. Migrating to nanoc 3.0
  10. API documentation
  11. Wiki

Installation

Installing Ruby

nanoc is written in Ruby, so you will need to install a Ruby interpreter. Ruby 1.8.6 and up, including Ruby 1.9, is supported. You can even use one of the alternative Ruby implementations (JRuby, Rubinius, …) if you want to do so.

You may have Ruby installed already. To check whether Ruby is installed on your system, open a terminal window and type irb; if you get a “command not found” then Ruby is not yet installed. This is what it should look like (hit ⌃D or type quit to exit from irb):

% irb
ruby-1.9.1-p378 > quit
% 

If Ruby is not installed on your system yet, check out the Ruby downloads page to download a Ruby version for your system.

Installing Rubygems

Rubygems is Ruby’s package manager. With it, you can easily find and install new packages (called gems). While not stricly necessary in order to use nanoc, it is greatly recommended to install Rubygems anyway.

It’s likely that you have Rubygems installed already. If you want to check whether you have Rubygems installed, open a terminal window and type gem --version. If that command prints a version number, Rubygems is installed. This is what it should look like:

% gem --version
1.3.5
% 

To install Rubygems, go to the Rubygems download page and follow the instructions there.

If you have Rubygems installed already, make sure you have a fairly recent version. I’ve tested nanoc with Rubygems 1.3.5 and up, so consider upgrading if you’re experiencing issues with an older Rubygems. The Rubygems download page also contains instructions for upgrading Rubygems.

Installing nanoc

All dependencies are now taken care of, and installing nanoc should now be as easy as this (you may have to prefix the gem command with sudo to ensure that you’re using root privileges):

% gem install nanoc

To make sure that nanoc was installed correctly, run nanoc --version. It should print the version number along with some other information, like this:

% nanoc --version
nanoc 3.1.0 (c) 2007-2010 Denis Defreyne.
Ruby 1.9.1 (2010-01-10) running on i386-darwin10.2.0
% 

If you get a “command not found” error when trying to run nanoc, you may have to adjust your $PATH to include the path to the directory where Rubygems installs executables. For example, on Ubuntu the $PATH should include /var/lib/gems/1.8/bin.

The current version of nanoc is is 3.1.5, released on August 24th, 2010. You can find the release notes for this version as well as release notes for older versions on the release notes page.

If you’re on Windows and are using the Windows console, it’s probably a good idea to install the win32console gem using gem install win32console to allow nanoc to use pretty colors when writing stuff to the terminal.