views:

466

answers:

3

When I install Ruby-LDAP on my Snow Leopard box, all appears to go well:

$ sudo gem install ruby-ldap
Building native extensions.  This could take a while...
Successfully installed ruby-ldap-0.9.9
1 gem installed
Installing ri documentation for ruby-ldap-0.9.9...
Installing RDoc documentation for ruby-ldap-0.9.9...

But when I run the Ruby script that relies on it, I get this error:

in 'require': no such file to load -- ldap (LoadError)

I also tried setting ARCHFLAGS, since doing so appears to be required for the MySQL gem to function correctly in Snow Leopard:

$ sudo env ARCHFLAGS="-arch x86_64" gem install ruby-ldap

Unfortunately, this produces exactly the same results (or lack thereof).

How do I get Ruby to work with the LDAP libraries correctly here?

+2  A: 

Make sure you

require 'rubygems'

first.

Peter
Haha! Well, aren't I an idiot? That's what I get for trusting inherited code.That did the trick. Appreciate it!
Sean McMains
A: 

gem install ruby-ldap

Jocke