This is wierd. I’m trying to get Ruby/LDAP up and working, and at least
the basics work fine under irb:
irb(main):001:0> require ‘ldap’
So far, so good. All LDAP::Conn.new does is call ldap_init with host
and port parameters, which in turn just allocates the control structure
– there’s no attempt to create a socket until later.
When I switch to Rails, though, this gets strange. Running inside a
brand new rails structure (this is 1.0.0), I do:
Loading development environment.
LDAP::ResultError: can’t initialise an LDAP session
from (irb):2:in `initialize’
When I first saw this, it was on my mac
ruby -v -> ruby 1.8.4
(2005-12-24) [powerpc-darwin8.5.0] with ruby-ldap-0.9.2, and I’ve
confirmed the behavior through ruby-ldap-0.9.4.
This isn’t just an OSX thing, though. I see the exact same error on my
gentoo box (originally 2004.1, but kept current, where
ruby -v -> ruby
1.8.4(2005-12-24) [i686-linux]), with everything up to and including
ruby-ldap-0.9.2 installed through portage.