# Anyone using Ruby-ldap with rails?

**URL:** <https://www.ruby-forum.com/t/anyone-using-ruby-ldap-with-rails/48556>\
**Category:** Rails\
**Created:** [November 22, 2005, 3:45am UTC](https://www.ruby-forum.com/t/anyone-using-ruby-ldap-with-rails/48556 "2005-11-22T03:45:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fernand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/8e8cbc/32.png) [@fernand](https://www.ruby-forum.com/u/fernand)\
**Post date:** [November 22, 2005, 3:45am UTC](https://www.ruby-forum.com/t/anyone-using-ruby-ldap-with-rails/48556/1 "2005-11-22T03:45:06Z")

</div>

Hi,

Anyone using Ruby-ldap withing Apache + fcgi ?

We are trying to lookup some entries in ldap using ruby-ldap and our  
scripts  
work great from the cmd line, however when we run within apache2 + fcgi  
we get  
the following error:

ruby: error.c:264: ldap\_parse\_result: Assertion `(  
(ld)-\>ld\_options.ldo\_valid ==  
0x2 )’ failed.

Any Ideas ?

---

<div class="post-metadata">

**Author:** ![fernand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/8e8cbc/32.png) [@fernand](https://www.ruby-forum.com/u/fernand)\
**Post date:** [November 22, 2005, 3:49am UTC](https://www.ruby-forum.com/t/anyone-using-ruby-ldap-with-rails/48556/2 "2005-11-22T03:49:07Z")

</div>

On Tue, Nov 22, 2005 at 02:39:23AM +0000, KiteSurfer wrote:

> Anyone using Ruby-ldap withing Apache + fcgi ?
> 
> We are trying to lookup some entries in ldap using ruby-ldap and our scripts  
> work great from the cmd line, however when we run within apache2 + fcgi we get  
> the following error:
> 
> ruby: error.c:264: ldap\_parse\_result: Assertion `( (ld)-\>ld\_options.ldo\_valid ==  
> 0x2 )’ failed.
> 
> Any Ideas ?

I don’t have any tips about your specific error but you may be  
interested in  
the ActiveLDAP project. It aims to be ActiveRecord for LDAP:

[http://dataspill.org/posts/show/4](http://dataspill.org/posts/show/4)

## marcel

Marcel Molina Jr. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![fernand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/8e8cbc/32.png) [@fernand](https://www.ruby-forum.com/u/fernand)\
**Post date:** [November 22, 2005, 5:41am UTC](https://www.ruby-forum.com/t/anyone-using-ruby-ldap-with-rails/48556/3 "2005-11-22T05:41:39Z")

</div>

Thanks Marcel, I am aware of the ActiveLdap project and it the model is  
based  
entirely on ruby-ldap which I think is flawed. If you look at the  
comment on the  
blog entry you’ve send, you will see that someone is running into the  
exact same  
problem we are having ie fcgi eventually craps out.

Anyone running into this issue with Ruby-Ldap and is the Ruby-ldap  
project  
totally dead ?

Thanks…

---

<div class="post-metadata">

**Author:** ![fernand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/8e8cbc/32.png) [@fernand](https://www.ruby-forum.com/u/fernand)\
**Post date:** [November 24, 2005, 5:31am UTC](https://www.ruby-forum.com/t/anyone-using-ruby-ldap-with-rails/48556/4 "2005-11-24T05:31:27Z")

</div>

Thanks for the reply Matt. We are binding and reading only. We have a  
very similar configuration -Apache version. I am thinking either bailing  
out of Apache2 or going lighttpd. Not sure if this is web server related  
though…

Which LDAP server are you using ?

Thanks !!

---

<div class="post-metadata">

**Author:** ![fernand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/8e8cbc/32.png) [@fernand](https://www.ruby-forum.com/u/fernand)\
**Post date:** [November 24, 2005, 9:46am UTC](https://www.ruby-forum.com/t/anyone-using-ruby-ldap-with-rails/48556/5 "2005-11-24T09:46:26Z")

</div>

On Thu, Nov 24, 2005 at 05:31:27AM +0100, KiteSurfer wrote:

> Thanks for the reply Matt. We are binding and reading only. We have a  
> very similar configuration -Apache version. I am thinking either bailing  
> out of Apache2 or going lighttpd. Not sure if this is web server related  
> though…
> 
> Which LDAP server are you using ?

We’re actually using LDAP to speak with Microsoft’s Active Directory,  
both Win2K and Win2003 versions. Trouble-free so far…

---

<div class="post-metadata">

**Author:** ![fernand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/8e8cbc/32.png) [@fernand](https://www.ruby-forum.com/u/fernand)\
**Post date:** [November 22, 2005, 11:48am UTC](https://www.ruby-forum.com/t/anyone-using-ruby-ldap-with-rails/48556/6 "2005-11-22T11:48:05Z")

</div>

On Tue, Nov 22, 2005 at 02:39:23AM +0000, KiteSurfer wrote:

> Hi,
> 
> Anyone using Ruby-ldap withing Apache + fcgi ?
> 
> We are trying to lookup some entries in ldap using ruby-ldap and our scripts  
> work great from the cmd line, however when we run within apache2 + fcgi we get  
> the following error:
> 
> ruby: error.c:264: ldap\_parse\_result: Assertion `( (ld)-\>ld\_options.ldo\_valid ==  
> 0x2 )’ failed.

This may not be very helpful but we are running Apache 1.3.33 + Rails  
0.13.1 + FCGI Dev Kit 2.4.0 + ruby-fcgi 0.8.5 + OpenLDAP 2.2.26 +  
ruby-ldap 0.9.1  
on FreeBSD with no problems.

However, our use is bind & read-only…not sure if your error is related  
to a write/modify operation.
