# Ldap and ruby

**URL:** <https://www.ruby-forum.com/t/ldap-and-ruby/160283>\
**Category:** Ruby\
**Created:** [February 13, 2009, 6:15pm UTC](https://www.ruby-forum.com/t/ldap-and-ruby/160283 "2009-02-13T18:15:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_LSSS\_hr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@Jan\_LSSS\_hr](https://www.ruby-forum.com/u/Jan_LSSS_hr)\
**Post date:** [February 13, 2009, 6:15pm UTC](https://www.ruby-forum.com/t/ldap-and-ruby/160283/1 "2009-02-13T18:15:51Z")

</div>

Hello,

I’m using ruby/ldap ([http://ruby-ldap.sourceforge.net/](http://ruby-ldap.sourceforge.net/)) for accessing  
ldap-Servers so far, but run in a few issues with active directory  
servers while using openldap2 as backend. (Crendentials seem to be  
forgotten during searches)

Since ruby/ldap seems to be inactive so far (last release was in 2006)  
I’m looking for alternatives.

ruby-net-ldap drew my attention, but this seem to be abandoned either.

Do you know any alternatives?

Thanks,  
Keep smiling  
yanosz

---

<div class="post-metadata">

**Author:** ![Jan\_LSSS\_hr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@Jan\_LSSS\_hr](https://www.ruby-forum.com/u/Jan_LSSS_hr)\
**Post date:** [February 13, 2009, 8:59pm UTC](https://www.ruby-forum.com/t/ldap-and-ruby/160283/2 "2009-02-13T20:59:45Z")

</div>

Jan LÃ¼hr wrote:

> ruby-net-ldap drew my attention, but this seem to be abandoned either.

Lack of updates doesn’t necessarily mean abandonment. I think  
ruby-net-ldap has just reached a stable point some years ago and needed  
no further refinement to serve its purpose.

In my experince, ruby-net-ldap has _much_ better documentation than  
ruby/ldap and is also simpler to use. Try it! 🙂

---

<div class="post-metadata">

**Author:** ![Jan\_LSSS\_hr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@Jan\_LSSS\_hr](https://www.ruby-forum.com/u/Jan_LSSS_hr)\
**Post date:** [February 20, 2009, 10:49pm UTC](https://www.ruby-forum.com/t/ldap-and-ruby/160283/3 "2009-02-20T22:49:31Z")

</div>

Jan LÃ¼hr wrote:

> Hello,
> 
> I’m using ruby/ldap ([http://ruby-ldap.sourceforge.net/](http://ruby-ldap.sourceforge.net/)) for accessing  
> ldap-Servers so far, but run in a few issues with active directory  
> servers while using openldap2 as backend. (Crendentials seem to be  
> forgotten during searches)
> 
> Since ruby/ldap seems to be inactive so far (last release was in 2006)  
> I’m looking for alternatives.
> 
> ruby-net-ldap drew my attention, but this seem to be abandoned either.
> 
> Do you know any alternatives?
> 
> Thanks,  
> Keep smiling  
> yanosz

I can also say, I’ve used ruby-net-ldap and was very happy with it. Give  
it a try!

---

<div class="post-metadata">

**Author:** ![Jan\_LSSS\_hr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@Jan\_LSSS\_hr](https://www.ruby-forum.com/u/Jan_LSSS_hr)\
**Post date:** [February 21, 2009, 7:08am UTC](https://www.ruby-forum.com/t/ldap-and-ruby/160283/4 "2009-02-21T07:08:15Z")

</div>

Adam G. wrote:

> I can also say, I’ve used ruby-net-ldap and was very happy with it. Give  
> it a try!

The downside is that it doesn’t seem to work with 1.9. I couldn’t  
get it to work at all even following up on some of the patches  
and bug reports on the RubyForge page.

The good news is I created a patch for ruby-ldap-0.9.7 to get it  
to work with ruby 1.9. I added it to the SourceForge tracker here  
in case anyone’s interested:

[https://sourceforge.net/tracker/index.php?func=detail&aid=2622809&group\_id=66444&atid=514521](https://sourceforge.net/tracker/index.php?func=detail&aid=2622809&group_id=66444&atid=514521)

By the way, you can go a long way to porting a C extension to ruby 1.9  
by just doing this:

ruby -pi -e ’  
gsub(/RARRAY\s\*((\S+?))-\>len/) { “RARRAY\_LEN(#{$1})” };  
gsub(/RARRAY\s\*((\S+?))-\>ptr/) { “RARRAY\_PTR(#{$1})” };  
gsub(/RSTRING\s\*((\S+?))-\>len/) { “RSTRING\_LEN(#{$1})” };  
gsub(/RSTRING\s\*((\S+?))-\>ptr/) { “RSTRING\_PTR(#{$1})” }; ’ file.c
