Solve gollum installation errors on OS X

Published on January 10, 2016 in How-tos
Read time: 1 min

You’re going to setup gollum gem on your Mac, maybe because you need to edit locally the wiki for a repository hosted on GitLab or maybe just for your new blog.

But right after

gem install gollum

you get this output:

Fetching: useragent-0.14.0.gem (100%)
Successfully installed useragent-0.14.0
Fetching: mustache-0.99.8.gem (100%)
Successfully installed mustache-0.99.8
Fetching: rack-protection-1.5.3.gem (100%)
Successfully installed rack-protection-1.5.3
Fetching: sinatra-1.4.6.gem (100%)
Successfully installed sinatra-1.4.6
Fetching: kramdown-1.8.0.gem (100%)
Successfully installed kramdown-1.8.0
Fetching: github-markup-1.3.3.gem (100%)
Successfully installed github-markup-1.3.3
Fetching: sanitize-2.1.0.gem (100%)
Successfully installed sanitize-2.1.0
Fetching: stringex-2.5.2.gem (100%)
Successfully installed stringex-2.5.2
Fetching: rouge-1.10.1.gem (100%)
Successfully installed rouge-1.10.1
Fetching: charlock_holmes-0.7.3.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing gollum:
    ERROR: Failed to build gem native extension.

    /Users/francesco/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150923-5613-dmozac.rb extconf.rb
checking for main() in -licui18n... no
checking for main() in -licui18n... no

*********** icu required (brew install icu4c or apt-get install libicu-dev) ***********
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:

extconf failed, exit code 1

Gem files will remain installed in /Users/francesco/.rvm/gems/ruby-2.1.5/gems/charlock_holmes-0.7.3 for inspection.
Results logged to /Users/francesco/.rvm/gems/ruby-2.1.5/extensions/x86_64-darwin-14/2.1.0-static/charlock_holmes-0.7.3/gem_make.out


How to solve this? Well, it is kinda straightforward. icu native package is all new need. Here I install it via macports but it is available (under different names) also on homebrew and Linux.

sudo port install icu

Then we need to install charlock_holmes specifing the icu directory:

gem install charlock_holmes -- --with-icu-dir=/opt/local

Now we can re-run the gollum install command

gem install gollum


Thanks for reading.


Got some words you want to share? Tell me!