Recently I ran into some trouble with the way I was trying to use the Mongoid gem. Eventually I realized that RSpec was filtering out parts of my backtrace.
I came across a few Ruby libraries for connecting to Active Directory, but I used net-ldap gem, the environment_configurable gem and a few lines of code.