Problem with irb on OS X

I run Tiger on a Macbook. I installed Ruby and Rails by the DarwinPorts
method. I tried to run irb, and I get the following:

Macbook:~ aaron$ irb
dyld: NSLinkModule() error
dyld: Library not loaded: /opt/local/lib/libreadline.5.0.dylib
Referenced from:
/opt/local/lib/ruby/1.8/i686-darwin8.6.2/readline.bundle
Reason: image not found
Trace/BPT trap

It turns out that readline is installed.

Macbook:~ aaron$ sudo port installed readline
Password:
The following ports are currently installed:
readline @5.0.005_0+darwin_8
readline @5.1.004_0 (active)
Macbook:~ aaron$

But when I try to uninstall either version, to reinstall it… they both
say
they depend on ruby and postgresql8. So I’m stuck.

Any ideas?

Thanks,

Aaron K.
SuperLag - irc.freenode.net

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18 Jun 2006, at 08:04, Aaron K. wrote:

Macbook:~ aaron$ sudo port installed readline
Password:
The following ports are currently installed:
readline @5.0.005_0+darwin_8
readline @5.1.004_0 (active)
Macbook:~ aaron$

But when I try to uninstall either version, to reinstall it… they
both say
they depend on ruby and postgresql8. So I’m stuck.

The problem is that ruby was compiled when readline 5.0 was installed
so it links against the 5.0 dylib. There are several ways to fix it:

  1. Uninstall ruby and recompile it. Now it will find that readline
    5.1 is installed and link against it
  2. Make a symbolic link like so:

sudo ln -s /opt/local/lib/libreadline.5.1.dylib /opt/local/lib/
libreadline5.0.dylib

Now it will find the dylib and hopefully it will work.

Solution 1) is cleaner but solution 2) is faster.

BTW: If you want to uninstall a port and you are really sure what you
are doing you can do ‘port -f uninstall ’.

Urban


http://bettong.net - Urban’s Blog

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFElQl7ggNuVCIrEyURAvSjAJ4lXuo8tuP4mr+aKO9DIopE7TlofACfR5PJ
D/+n5NuUELQPi+zKASgxvbw=
=/3yE
-----END PGP SIGNATURE-----