google-code-export / ruby-activeldap

Automatically exported from code.google.com/p/ruby-activeldap
Other
1 stars 1 forks source link

Using activeldap-trunk's UserPassword class with ssha method #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to use the ssha method of the UserPassword class of ActiveLdap 
(trunk), on rails 2.1.2 
(since I couldn't get the models to generate with 2.2.2)

I've installed activeldap-trunk under my rails vendors dir, and have it 
appropriately included in 
my environment.rb .

From my rails root, I run:

# ./script/console development
Loading development environment (Rails 2.1.2)
>> require 'active_ldap'
=> []
>> pw = ActiveLdap::UserPassword.ssha('pw')
NameError: "Activeldap-trunk::Lib::ActiveLdap" is not a valid constant name!
    from /Library/Ruby/Gems/1.8/gems/activesupport-
2.1.2/lib/active_support/dependencies.rb:116:in `qualified_const_defined?'
    from /Library/Ruby/Gems/1.8/gems/activesupport-
2.1.2/lib/active_support/dependencies.rb:339:in `new_constants_in'
    from /Library/Ruby/Gems/1.8/gems/activesupport-
2.1.2/lib/active_support/dependencies.rb:331:in `collect'
    from /Library/Ruby/Gems/1.8/gems/activesupport-
2.1.2/lib/active_support/dependencies.rb:331:in `new_constants_in'
    from /Library/Ruby/Gems/1.8/gems/activesupport-
2.1.2/lib/active_support/dependencies.rb:215:in `load_file'
    from /Library/Ruby/Gems/1.8/gems/activesupport-
2.1.2/lib/active_support/dependencies.rb:96:in `require_or_load'
    from /Library/Ruby/Gems/1.8/gems/activesupport-
2.1.2/lib/active_support/dependencies.rb:261:in `load_missing_constant'
    from /Library/Ruby/Gems/1.8/gems/activesupport-
2.1.2/lib/active_support/dependencies.rb:468:in `const_missing'
    from (irb):2

I have a current copy of trunk:

[%RAILS_ROOT/vendor/activeldap-trunk]: svn up

Fetching external item into 'test-unit'
External at revision 184.

At revision 796.

Is there any way around this?  I'm simply trying to hash a password to save it.

Thanks

Original issue reported on code.google.com by michael....@gmail.com on 6 Jan 2009 at 8:46

GoogleCodeExporter commented 9 years ago
How did you setup your environment? Are you use the way?
http://code.google.com/p/ruby-activeldap/wiki/UsingTrunkWithRails

You don't have #{RAILS_ROOT}/lib/activeldap-trunk/lib/active_ldap.rb, don't you?

Original comment by kou...@gmail.com on 10 Jan 2009 at 6:17

GoogleCodeExporter commented 9 years ago
I had set it up exactly as in the instructions.  My environment.rb changes are:

config.load_paths += %W(#{RAILS_ROOT}/vendor/activeldap-trunk/lib)
config.plugin_paths += %W(#{RAILS_ROOT}/vendor/activeldap-trunk/rails/plugin)

I do however a require of 'active_ldap', but removing it does nothing to change 
the result.

Original comment by michael....@gmail.com on 15 Jan 2009 at 3:25

GoogleCodeExporter commented 9 years ago
I could reproduce it on my environment.
I've fixed it in trunk.

Original comment by kou...@gmail.com on 16 Jan 2009 at 3:01

GoogleCodeExporter commented 9 years ago
Thanks for fixing it.  It works for me as well in trunk.

Original comment by michael....@gmail.com on 21 Jan 2009 at 2:01