Compile Ruby 1.9.2 with RVM using Homebrew installed Iconv

January 30, 2011  |  Posted in: Programming  |  1 comments

Tags: / / /

I spent a very frustrating hour this morning trying to get the JSON gem to work on Ruby 1.9.2 p136 installed via RVM on Snow Leopard. I thought I would post my solution to help any other unfortunate souls.

The RVM docs suggest installing a sandboxed version of Iconv like so:

$ rvm package install iconv

This didn’t work. I got archictecture errors during compile. I then tried to install the iconv gem, which again didn’t work. It couldn’t seem to find the iconv lib files.

In the end, I installed icon with Homebrew and linked it to Ruby like so:

$ brew install libiconv
$ rvm remove 1.9.2
$ rvm install 1.9.2 --with-iconv-dir=/usr/local/Cellar/libiconv/1.13.1

This compiled Ruby with the Homebrew installed iconv libraries and the json gem worked just fine after.

Comments

very useful, thx

fanix | posted on Wed, Feb 2nd 2011, 00:03

Make a comment

Privacy: I will never give/sell/share your email address with anyone, ever. I need it to help crack down on spam, and contact you if I have a question about your comment that would be best handled in private.

A red label and/or an asterisk (*) indicates a required field

this will never be made public
(optional)

Preview:

Recent posts

Introducing Phrap

0 Comments :: August 28, 2011

Compile Ruby 1.9.2 with RVM using Homebrew installed Iconv

1 Comments :: January 30, 2011

Bending CSVs to your will with Ruby

0 Comments :: September 05, 2010

Git Down

0 Comments :: August 21, 2010

It's been a long time coming.

0 Comments :: February 01, 2010

Search the posts

Categories

Browse around

© 2012 Darren Newton, all rights reserved - Revision 334