Omen, It looks like you've installed the gem into the agent's gem path instead of the server's. Puppetserver's docs[1] have details on how to install a gem for puppetserver. However, ruby-ldap is a compiled gem that won't work with jruby, so jruby-ldap is the gem you'd want to use on the server. But, jruby-ldap has a few issues[2], so even then it might not work. The bug I've linked is about the LDAP terminus, so if you're writing a custom function using ldap, it may work. jruby-ldap should have the same interface as ruby-ldap, so it should just drop in and work.
If jruby-ldap doesn't work for you, there is a pure ruby ldap library called ruby-net-ldap[3]. It looks like it has a different interface than ruby-ldap, so it would probably require some rewriting of your function. [1] - https://docs.puppetlabs.com/puppetserver/2.1/gems.html#installing-and-removing-gems [2] - https://tickets.puppetlabs.com/browse/SERVER-711 [3] - https://github.com/ruby-ldap/ruby-net-ldap On Thu, Jul 16, 2015 at 6:15 PM, Omen Wild <o...@ucdavis.edu> wrote: > I have a fresh install of Puppet 4.2 on an Ubuntu 14.04 box: > root@puppet:~# /opt/puppetlabs/bin/puppetserver -v > puppetserver version: 2.1.1 > > We have a locally written Ruby command to do a LDAP lookup to get UIDs > for our users, but with Puppet 4.2 it errors out: > > ----- Begin error ----- > root@puppet:~# puppet agent -t > Info: Retrieving pluginfacts > Info: Retrieving plugin > Info: Loading facts > Error: Could not retrieve catalog from remote server: Error 500 on SERVER: > Internal Server Error: org.jruby.exceptions.RaiseException: (LoadError) no > such file to load -- ldap > Warning: Not using cache on failed catalog > Error: Could not retrieve catalog; skipping run > ----- End error ----- > > I installed the gem with: > > ----- Begin quote ----- > root@puppet:/etc/puppetlabs/code# /opt/puppetlabs/puppet/bin/gem install > ruby-ldap > root@puppet:/etc/puppetlabs/code# /opt/puppetlabs/puppet/bin/gem list > ruby-ldap > > *** LOCAL GEMS *** > > ruby-ldap (0.9.17) > ----- End quote ----- > > The full back-trace is attached. > > The same Ruby file works with Puppet 3.8.1 on Ubuntu 12.04 with the > ruby-ldap package installed (not as a gem). > > What am I missing? > > Thanks, > Omen > > -- > Omen Wild > Systems Administrator > Metro Cluster > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/20150717011546.GB10028%40descolada.ucdavis.edu. > For more options, visit https://groups.google.com/d/optout. -- Matthaus Owens Puppet Labs PuppetConf 2015 is coming to Portland, Oregon! Join us October 5-9. Register now to take advantage of the Early Bird discount —save $249! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACD%3DwAe0KcBtucYwQi4%3DXUaNDu4%3DdAAoVdSHQL80%3DT3rfdaHEA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.