Last Updated: February 25, 2016
· argent-smith

Ruby 1.9.X RVM w/iconv FreeBSD installation HOWTO

The Problem

Recently, trying to run some of my crutches (the Ruby thingies I use to help me sysadmining) under RVM, I've found that require 'iconv' doesn't work. Since I knew it's working in standard lang/ruby18 and lang/ruby19 ports I started to search where is the trap and have found that. Here's how.


  • rvm installed
  • system ruby installed
  • libiconv port installed


  1. $ rvm use system
  2. $ rvm install 1.9.2 -C --with-iconv-dir=/usr/local

Verifying install

$ rvm use 1.9.2    
$ irb
ruby-1.9.2-p290 :001 > require 'iconv'
=> true 

Important note

The same way you can build iconv'ed 1.8.7. DO NOT do this with Rubinius (rbx) because it builds with correct iconv'ification out of the box.