Topic: Unable to Install Ruby 1.8.6 on OS X (10.4.10)

My Environment:
MacBook Pro (Intel) running Tiger (10.4.10).
Default Ruby Version:
[/usr/local/src]ruby -v
ruby 1.8.2 (2004-12-25) [universal-darwin8.0]

I'm using tcsh shell.

The files:
[/usr/local/src]ls
readline-5.2/   ruby-1.8.6/

--------

The book says I need a more-recent version of Ruby.  So I followed the procedures:

1) My Path:
[/usr/local/src]echo $PATH
/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local:/usr/local/bin:/usr/local/BerkeleyDB.4.5/bin:/usr/local/php5/bin:/usr/local/mysql/bin:/opt/local:/opt/local/bin:/Library/FrontBase/bin:/Library/Frameworks/Python.framework/Versions/Current/bin

The important locals are /usr/local & /usr/local/bin.

2) I need 'readline'.  So I downloaded the latest (version 5.2) and following the installation instructions.  This is where my problems start.  I tried $>which readline to see if OS X sees it.  It doesn't.

Installing readline failed;

./configure wrote:

[/usr/local/src/readline-5.2]sudo ./configure --prefix=/usr/local
checking build system type... i386-apple-darwin8.10.1
checking host system type... i386-apple-darwin8.10.1

Beginning configuration for readline-5.2 for i386-apple-darwin8.10.1

checking whether make sets $(MAKE)... yes
checking for gcc... /opt/local/ccache/bin/cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/local/ccache/bin/cc accepts -g... yes
checking for /opt/local/ccache/bin/cc option to accept ANSI C... none needed
checking how to run the C preprocessor... /opt/local/ccache/bin/cc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether /opt/local/ccache/bin/cc needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for ar... ar
checking for ranlib... ranlib
checking for an ANSI C-conforming const... yes
checking for function prototypes... yes
checking whether char is unsigned... no
checking return type of signal handlers... void
checking for size_t... yes
checking for ssize_t... yes
checking for ANSI C header files... (cached) yes
checking whether stat file-mode macros are broken... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for fcntl... yes
checking for kill... yes
checking for lstat... yes
checking for memmove... yes
checking for putenv... yes
checking for select... yes
checking for setenv... yes
checking for setlocale... yes
checking for strcasecmp... yes
checking for strpbrk... yes
checking for tcgetattr... yes
checking for vsnprintf... yes
checking for isascii... yes
checking for isxdigit... yes
checking for getpwent... yes
checking for getpwnam... yes
checking for getpwuid... yes
checking for working strcoll... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking varargs.h usability... no
checking varargs.h presence... no
checking for varargs.h... no
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking for memory.h... (cached) yes
checking termcap.h usability... yes
checking termcap.h presence... yes
checking for termcap.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking termio.h usability... no
checking termio.h presence... no
checking for termio.h... no
checking sys/pte.h usability... no
checking sys/pte.h presence... no
checking for sys/pte.h... no
checking sys/stream.h usability... no
checking sys/stream.h presence... no
checking for sys/stream.h... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking for sys/ptem.h... no
checking for type of signal functions... posix
checking if signal handlers must be reinstalled when invoked... no
checking for presence of POSIX-style sigsetjmp/siglongjmp... present
checking for lstat... yes
checking whether or not strcoll and strcmp differ... no
checking whether the ctype macros accept non-ascii characters... yes
checking whether getpw functions are declared in pwd.h... yes
checking whether termios.h defines TIOCGWINSZ... yes
checking whether signal handlers are of type void... yes
checking for TIOCSTAT in sys/ioctl.h... yes
checking for FIONREAD in sys/ioctl.h... yes
checking for speed_t in sys/types.h... no
checking for struct winsize in sys/ioctl.h and termios.h... sys/ioctl.h
checking for struct dirent.d_ino... yes
checking for struct dirent.d_fileno... yes
checking for tgetent... no
checking for tgetent in -ltermcap... yes
checking which library has the termcap functions... using libtermcap
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for mbsrtowcs... yes
checking for mbrlen... yes
checking for wcrtomb... yes
checking for wcscoll... yes
checking for wcsdup... no
checking for wcwidth... yes
checking for wctype... yes
checking whether mbrtowc and mbstate_t are properly declared... yes
checking for iswlower... yes
checking for iswupper... yes
checking for towlower... yes
checking for towupper... yes
checking for iswctype... yes
checking for nl_langinfo and CODESET... yes
checking for wchar_t in wchar.h... yes
checking for wctype_t in wctype.h... yes
checking for wint_t in wctype.h... yes
checking configuration for building shared libraries... supported
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating examples/Makefile
config.status: creating shlib/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default commands

[/usr/local/src/readline-5.2]sudo make
test -d shlib || mkdir shlib
( cd shlib ; make  all )
make[1]: Nothing to be done for `all'.

[/usr/local/src/readline-5.2]sudo make install
/bin/sh ./support/mkinstalldirs /usr/local/include \
        /usr/local/include/readline /usr/local/lib \
        /usr/local/info /usr/local/man/man3
for f in readline.h chardefs.h keymaps.h history.h tilde.h rlstdc.h rlconf.h rltypedefs.h; do \
        /usr/bin/install -c -m 644 ./$f /usr/local/include/readline ; \
done
( if test -d doc ; then \
        cd doc && \
        make  infodir=/usr/local/info DESTDIR= install; \
  fi )
/bin/sh ../support/mkdirs /usr/local/info /usr/local/man/man3
if test -n "" ; then \
        /bin/sh ../support/mkdirs  ; \
fi
if test -f readline.info; then \
        /usr/bin/install -c -m 644 readline.info /usr/local/info/readline.info; \
else \
        /usr/bin/install -c -m 644 ./readline.info /usr/local/info/readline.info; \
fi
if test -f rluserman.info; then \
        /usr/bin/install -c -m 644 rluserman.info /usr/local/info/rluserman.info; \
else \
        /usr/bin/install -c -m 644 ./rluserman.info /usr/local/info/rluserman.info; \
fi
if test -f history.info; then \
        /usr/bin/install -c -m 644 history.info /usr/local/info/history.info; \
else \
        /usr/bin/install -c -m 644 ./history.info /usr/local/info/history.info; \
fi
if /bin/sh -c 'install-info --version' >/dev/null 2>&1; then \
        install-info --dir-file=/usr/local/info/dir \
                /usr/local/info/readline.info ; \
        install-info --dir-file=/usr/local/info/dir \
                /usr/local/info/history.info ; \
        install-info --dir-file=/usr/local/info/dir \
                /usr/local/info/rluserman.info ; \
else true; fi
* Readline: (readline). The GNU readline library API.
install-info(/usr/local/info/readline.info): no backup file /var/backups/infodir.bak available.
install-info(/usr/local/info/readline.info): no default file /usr/share/base-files/info.dir available, giving up.
* History: (history). The GNU history library API.
install-info(/usr/local/info/history.info): no backup file /var/backups/infodir.bak available.
install-info(/usr/local/info/history.info): no default file /usr/share/base-files/info.dir available, giving up.
* RLuserman: (rluserman). The GNU readline library User's Manual.
install-info(/usr/local/info/rluserman.info): no backup file /var/backups/infodir.bak available.
install-info(/usr/local/info/rluserman.info): no default file /usr/share/base-files/info.dir available, giving up.
make[1]: [install] Error 1 (ignored)
/usr/bin/install -c -m 644 ./readline.3 /usr/local/man/man3/readline.3
/usr/bin/install -c -m 644 ./history.3 /usr/local/man/man3/history.3
if test -n "" ; then \
        if test -f readline.html; then \
                /usr/bin/install -c -m 644 readline.html /readline.html; \
        else \
                /usr/bin/install -c -m 644 ./readline.html /readline.html; \
        fi ; \
        if test -f history.html; then \
                /usr/bin/install -c -m 644 history.html /history.html; \
        else \
                /usr/bin/install -c -m 644 ./history.html /history.html; \
        fi ; \
        if test -f rluserman.html; then \
                /usr/bin/install -c -m 644 rluserman.html /rluserman.html; \
        else \
                /usr/bin/install -c -m 644 ./rluserman.html /rluserman.html; \
        fi ; \
fi
mv /usr/local/lib/libreadline.a /usr/local/lib/libreadline.old
/usr/bin/install -c -m 644 libreadline.a /usr/local/lib/libreadline.a
test -n "ranlib" && ranlib /usr/local/lib/libreadline.a
mv /usr/local/lib/libhistory.a /usr/local/lib/libhistory.old
/usr/bin/install -c -m 644 libhistory.a /usr/local/lib/libhistory.a
test -n "ranlib" && ranlib /usr/local/lib/libhistory.a
test -d shlib || mkdir shlib
( cd shlib ; make  all )
make[1]: Nothing to be done for `all'.
( cd shlib ; make  DESTDIR= install )
/bin/sh ../support/mkdirs /usr/local/lib
/bin/sh ../support/shlib-install -O darwin8.10.1 -d /usr/local/lib -b /usr/local/bin -i "/usr/bin/install -c -m 644" libhistory.5.2.dylib
/bin/sh ../support/shlib-install -O darwin8.10.1 -d /usr/local/lib -b /usr/local/bin -i "/usr/bin/install -c -m 644" libreadline.5.2.dylib
install: you may need to run ldconfig

I tried to run 'ldconfig':
[/usr/local/src/readline-5.2]ldconfig
tcsh: ldconfig: Command not found.

So it appears that installing ReadLine is the first problem.  Perhaps when this is solved, the actual Ruby installation shall be 'okay'.

So...
1) How do I test for readline?
2) What am I missing here?
3) Do I really need to run ldconv?
4) Is all my problems due to running tcsh vs bash?

Regards,

Ric.

Re: Unable to Install Ruby 1.8.6 on OS X (10.4.10)

might wanna follow this

http://hivelogic.com/narrative/articles … -mysql-osx

it points you to readline-5.1, not sure if that makes a difference

I know that howto works, I've used it on 10.4(.9) before and gotten a successful rails installation

Re: Unable to Install Ruby 1.8.6 on OS X (10.4.10)

I eventually found that I had some legacy PPC libraries that where imported from my PPC Mac onto my Intel MacBook Pro during the initial setup phase.   So I removed the entire directory of 'em and started from scratch.

Eventually things fell in place.

smile

Re: Unable to Install Ruby 1.8.6 on OS X (10.4.10)

You've probably already fixed this by now but just for future reference if you have any more trouble like this, I use MacPorts to install open source on my Mac, like Ruby and Xfce. It handles all the dependencies and updating is a snap.

It works exactly the same as the FreeBSD ports system which drew me to it. DarwinPorts.com is the equivalent to Freshports.org or pkgsrc.se.

# port -v selfupdate
# port -v install XYZ
# port -v installed

The -v flag makes the installer verbose, otherwise you won't get any feedback until it's finished.

NetBSD, FreeBSD, Mac OS X (with pkgsrc)
"Capistrano? Sounds like coffee. Mmm... coffee..."