There seems to be an issue with the system readline utility which prevents Rubies installed by rvm from being compiled. A possible fix to this is to install your own version of readline.
Errors in the make log:
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
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
Your own readline
Compile and install your own readline:
curl -O ftp://ftp.gnu.org/gnu/readline/readline-6.1.tar.gz
tar xzvf readline-6.1.tar.gz
cd readline-6.1
./configure --prefix=/usr/local
make
sudo make install
cd ..
tar xzvf readline-6.1.tar.gz
cd readline-6.1
./configure --prefix=/usr/local
make
sudo make install
cd ..
Give rvm another try …
First you have to remove Ruby versions you tried to compile before:
rvm remove 1.9.1
The following command with a reference to the newly installed newline should do the job:
rvm install 1.9.1 -C --with-readline-dir=/usr/local/
That is ist. RVM is working great now. Thanks a lot.
-Till
Sweeeet! This is a quality of life improving post. That was an annoying problem, and compiling readline into the rvm directory as suggested in the rvm docs didn’t help.
I fought with this for nearly a day before I found this. Worked like a champ for reinstalling 1.9.1p-0 and 1.9.1-p378 after I upgrading to Snow Leopard. Boy has _that_ been a fun cycle of recompiling lots of stuff!
You have been a much better solution to this problem than anyone else, including the rvm folks. Thanks a lot
That worked for ruby 1.8.8 too. Thanks for the post!
This fixed both 1.8.7 and 1.9.2 for me — thanks Niwo!
Yay! Works.
Perfect man, RVM + REE on Snow Leopard, working great! Thanks
Thanks alot! New to the Ruby community. This helped me get both two versions of rails installed.
Awesome, this solved my problem!
Great! I’ve spent hours trying to install ruby via rvm until I stumbled upon your solution!
Thanks a lot!
Thanx, relieved the aggravation… working like charm now.
Thanks for the post, any clue if you can set –with-readline-dir=/usr/local/ as a default flag with rvm?
OMG – this problem has kept me out of action for weeks. Wish I’d seen this post earlier! 1.8.7 under RVM is now working again. Thanks heaps!
Rails and ruby seems to get worse every release – along with minor tweaks to make all previous scripts break. Thanks for this, kept me from descending further into the inferno.
Thanks! Worked well for 1.8.7 (and jruby, though I didn’t try to install jruby without the readline switch).
No luck with this on Lion:
I got this
gcc-4.2 -dynamic -arch_only `/usr/bin/arch` -install_name /usr/local/lib/libreadline.6.1.dylib -current_version 6.1 -compatibility_version 6 -v -o libreadline.6.1.dylib readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so compat.so -lncurses
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/gcc/gcc-5666.3~278/src/configure –disable-checking –enable-werror –prefix=/usr –mandir=/share/man –enable-languages=c,objc,c++,obj-c++ –program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ –with-slibdir=/usr/lib –build=i686-apple-darwin11 –program-prefix=i686-apple-darwin11- –host=x86_64-apple-darwin11 –target=i686-apple-darwin11 –with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
i686-apple-darwin11-gcc-4.2.1: -compatibility_version only allowed with -dynamiclib
make[1]: *** [libreadline.6.1.dylib] Error 1
make: [shared] Error 2 (ignored)
I had same problem as above user. I tried using v 6.2 but solution is at
http://www.iamseree.com/application-development/readline-6-2-make-error-in-mac-os-x-lion
—–
curl -O ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz
tar xzvf readline-6.2.tar.gz
cd readline-6.2
./configure –prefix=/usr/local
cd shlib
sed -e ‘s/-dynamic/-dynamiclib/’ Makefile > Makefile.good
mv Makefile.good Makefile
cd ..
make
sudo make install
make
sudo make install
cd ..