# Problem with irb on OS X

**URL:** <https://www.ruby-forum.com/t/problem-with-irb-on-os-x/63725>\
**Category:** Ruby\
**Created:** [June 18, 2006, 8:07am UTC](https://www.ruby-forum.com/t/problem-with-irb-on-os-x/63725 "2006-06-18T08:07:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a6a055/32.png) [@Aaron\_K](https://www.ruby-forum.com/u/Aaron_K)\
**Post date:** [June 18, 2006, 8:07am UTC](https://www.ruby-forum.com/t/problem-with-irb-on-os-x/63725/1 "2006-06-18T08:07:33Z")

</div>

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](http://irc.freenode.net)

---

<div class="post-metadata">

**Author:** ![Aaron\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a6a055/32.png) [@Aaron\_K](https://www.ruby-forum.com/u/Aaron_K)\
**Post date:** [June 18, 2006, 10:07am UTC](https://www.ruby-forum.com/t/problem-with-irb-on-os-x/63725/2 "2006-06-18T10:07:55Z")

</div>

-----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](http://bettong.net) - Urban’s Blog

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

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