Today I was installing ruby-1.8.7-p330 on my MacBook Pro for my RVM instance.  I kept getting these weird errors about readline.c, I had no idea what the readline.c was or what it was used for.

readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1

After some Googl'in I learned that Readline is a C library that is used for reading in a line of text from a provided file handle and returns a character pointer.  When Ruby was trying to build it was having a conflict with the version of Readlines that were installed on the system, there were  two, one that came with OS X and one that was installed my MacPort.

OS X has it installed in /usr/lib and MacPorts has it installed in /usr/local/lib.

We have to use the version that was installed by MacPorts.

Specify the version of Readline to use when installing ruby-1.8.7-p33 like this:

rvm install ruby-1.8.7-p330 --with-readline-dir=/usr/local
Once I specified the location of readline the installed went through successfully.