Installing ActiveLdap on Ubuntu Dapper 6.06 LTS or Feisty 7.04

Ruby/ActiveLdap

...an object oriented interface to LDAP for Ruby on Rails...

Installing ActiveLdap on Ubuntu Dapper 6.06 LTS or Feisty 7.04
Installing ActiveLdap on Ubuntu Dapper 6.06 LTS or Feisty 7.04

Installing Ruby/ActiveLdap on Ubuntu Dapper 6.06 LTS or Feisty 7.04



  • Installing Ruby on Rails, RubyGems, and ActiveLdap on Dapper via apt-get is pretty well impossible. On Feisty, Ruby and RubyGems can be installed with apt-get, but the version of Ruby/ActiveLdap is very old (0.7.4).
    Read more on why you don't want to use the packaging system to install Rails.

    (2007-08-21) The following instructions worked for me:


Install openLDAP



  • Install slapd and db4.2-util:
    sudo apt-get install slapd db4.2-util



  • During install, you will be asked to provide a password. With this password you can administer the example database that is automatically created. The dn for this administrator is:
    cn=admin,dc=nodomain


  • Install the OpenLDAP development libraries, needed to compile ruby-ldap later on.
    sudo apt-get install libldap2-dev


  • Most likely, you want ssl compiled into ruby...
    sudo apt-get install libssl-dev



Install Ruby and RubyGems



  • Install Ruby.
    Check Ruby for the latest version.
    VERSION="1.9.1-p376" # adapt to your needs
    sudo apt-get install build-essential
    sudo apt-get install zlib1g-dev # we really need this
    wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-$VERSION.tar.gz
    tar zxvf ruby-$VERSION.tar.gz
    cd ruby-$VERSION
    ./configure
    make
    make test
    sudo make install
    sudo ln -s /usr/local/bin/ruby /usr/bin/ruby
    ruby -v # to see the installed version


  • Install RubyGems.
    Check RubyForge for the latest version.
    VERSION="1.3.5" # adapt to your needs
    RFID="60718" # adapt to your needs
    wget http://rubyforge.org/frs/download.php/$RFID/rubygems-$VERSION.tgz
    tar zxvf rubygems-$VERSION.tgz
    cd rubygems-$VERSION
    sudo ruby setup.rb
    gem -v # to see the installed version
    sudo gem install rubygems-update
    sudo gem update —system



Install Rails



  • Install Rails via RubyGems
    sudo gem install rails

    This should work, but it sometimes doesn't. I get the following error:
    Bulk updating Gem source index for: http://gems.rubyforge.org
    ERROR: While executing gem ... (Gem::GemNotFoundException)
    Could not find rails (> 0) in any repository

    Just try it again (maybe a couple of times) and eventually it will work. This problem is probably due to some timeout issues while downloading updates from the internet.


Install ruby-ldap and activeldap



  • Install Ruby/LDAP. It's not a gem yet. Check SourceForge for the latest version.
    VERSION="0.9.7" # adapt to your needs
    wget http://downloads.sourceforge.net/ruby-ldap/ruby-ldap-$VERSION.tar.gz
    tar zxvf ruby-ldap-$VERSION.tar.gz
    cd ruby-ldap-$VERSION
    ruby extconf.rb --with-openldap2
    make
    sudo make install


  • Install ActiveLdap via the ruby-activeldap gem.
    sudo gem install ruby-activeldap

    If the command fails, due to a timeout, just try it again. Eventually, it will work.


Download install-ruby-activeldap.tgz, a script that installs OpenLDAP, Ruby, RubyGems, Ruby/LDAP and Ruby/ActiveLdap, almost unattended.
Use at your own risk.


  • Test installation (quick and dirty).
    irb -rubygems

    This shoud bring you into irb where you can test activeldap:
    irb(main):001:0> require 'active_ldap'
    => true
    irb(main):002:0>



Developed with QwikZite (version 1.12)