I’m trying to use jruby-ldap in a rails 3 app running on jruby, and it
appears that jruby-ldap is failing to load. I do not get any actual
error on the require statement, and it returns nil - which appears to be
the norm from what I can tell. However as soon as I try to access one of
the constants that jruby-ldap is supposed to define, I get:
uninitialized constant FooController::LDAP
This is a vanilla app built for the sole purpose of testing jruby-ldap
in rails3. The equivalent test apps for jruby-ldap/rails2 and MRI
ruby-ldap/rail3 both work properly.
Is there a trick to requiring a lib in Rails 3, or is jruby-ldap not
ready for Rails 3 yet?
Actually, we got it working - the problem was that b/c of the way we
have our other gems set up, we needed to do “bundle install
path/to/gems” instead of just “bundle install.”
Actually, we got it working - the problem was that b/c of the way we
have our other gems set up, we needed to do “bundle install
path/to/gems” instead of just “bundle install.”
Thanks
Ok, I spoke too soon. It only works during the first request after
requiring the lib. After that, we get the same error, “uninitialized
constant FooController::LDAP” - or if we prefix the calls with ‘::’ then
we get
uninitialized constant LDAP
Currently to make it work, I have to do " require ‘ldap’ " in the
methods themselves so that it gets loaded at the beginning of every
request. It would be nice if anybody had any insight on what is going on
here…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.