Search code examples
rubymacosldaposx-snow-leopard

Ruby-LDAP and Snow Leopard


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?


Solution

  • Make sure you

    require 'rubygems'
    

    first.