# ActiveLDAP why are you so cruel to me? Help Please

**URL:** <https://www.ruby-forum.com/t/activeldap-why-are-you-so-cruel-to-me-help-please/78244>\
**Category:** Rails\
**Created:** [December 4, 2006, 1:30pm UTC](https://www.ruby-forum.com/t/activeldap-why-are-you-so-cruel-to-me-help-please/78244 "2006-12-04T13:30:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 4, 2006, 1:30pm UTC](https://www.ruby-forum.com/t/activeldap-why-are-you-so-cruel-to-me-help-please/78244/1 "2006-12-04T13:30:24Z")

</div>

Im running the latest ActiveLDAP 0.8. My problem is the following  
Ok, its simple.

This works:

xxxcatalog# ldapsearch -x -h 192.168.1.40 -W -D  
‘cn=Manager,dc=webgate,dc=net,dc=au’ -b ‘dc=webgate,dc=net,dc=au’  
‘(dc=www)’  
Enter LDAP Password:

# extended LDIF

# 

# LDAPv3

# base \<dc=webgate,dc=net,dc=au\> with scope subtree

# filter: (dc=www)

# requesting: ALL

# 

# www, lemra, com, domains, webgate.net.au

dn: dc=www,dc=lemra,dc=com,ou=domains,dc=webgate,dc=net,dc=au  
dc: www  
objectClass: top  
objectClass: dcObject  
objectClass: dNSDomain  
aRecord: 192.168.1.1

# search result

search: 2  
result: 0 Success

# numResponses: 2

# numEntries: 1

Ive got a ruby script to test ActiveLDAP to establish connection with  
the server:

require ‘rubygems’  
require ‘active\_ldap’

ActiveLDAP::Base.connect(  
:host =\> ‘192.168.1.40’,  
:port =\> 389,  
:base =\> ‘dc=webgate,dc=net,dc=au’,  
:bind\_format =\> ‘cn=Manager,dc=webgate,dc=net,dc=au’,  
:password\_block =\> Proc.new { ‘xxxx’ },  
:allow\_anonymous =\> false,  
:try\_sasl =\> false  
)

but i get this:

xxxcatalog# ruby ldaptest.rb  
/usr/pkg/lib/ruby/gems/1.8/gems/ruby-activeldap-0.8.0/lib/active\_ldap.rb:947:  
warning: already initialized constant VERSION  
/usr/pkg/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:100:in  
`const_missing': uninitialized constant ActiveLDAP (NameError) from /usr/pkg/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in`const\_missing’  
from ldaptest.rb:4

Has anyone got any clues please?

Petr

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 16, 2008, 6:33am UTC](https://www.ruby-forum.com/t/activeldap-why-are-you-so-cruel-to-me-help-please/78244/2 "2008-10-16T06:33:57Z")

</div>

Try replacing “ActiveLDAP::Base.connect” with  
“ActiveLdap::Base.establish\_connection”

James.

petr wrote:

> Ive got a ruby script to test ActiveLDAP to establish connection with  
> the server:
> 
> require ‘rubygems’  
> require ‘active\_ldap’
> 
> ActiveLDAP::Base.connect(  
> :host =\> ‘192.168.1.40’,  
> :port =\> 389,  
> :base =\> ‘dc=webgate,dc=net,dc=au’,  
> :bind\_format =\> ‘cn=Manager,dc=webgate,dc=net,dc=au’,  
> :password\_block =\> Proc.new { ‘xxxx’ },  
> :allow\_anonymous =\> false,  
> :try\_sasl =\> false  
> )
> 
> Petr
