我在OS X(Snow Leopard)系统上安装了ruby-net-ldap gem版本0.0.4。当我包括这条线......
config.gem('ruby-net-ldap')
在environment.rb中,我的测试将无法运行,我收到此错误...
Missing these required gems:
ruby-net-ldap
You're running:
ruby 1.8.6.0 at /usr/local/bin/ruby
rubygems 1.3.5 at /Users/ethan/.gem/ruby/1.8, /usr/local/lib/ruby/gems/1.8
Run `rake gems:install` to install the missing gems.
但是明确安装了宝石......
$ gem list -l | grep ldap
ruby-net-ldap (0.0.4)
我的其他宝石装得很好并且没有任何问题......
config.gem('mislav-will_paginate', :lib => 'will_paginate')
config.gem('haml')
config.gem('prawn')
config.gem('thoughtbot-shoulda', :lib => 'shoulda/rails')
config.gem('faker')
config.gem('binarylogic-searchlogic', :lib => 'searchlogic')
config.gem('fastercsv')
安装了gem之后,我可以在Rails控制台中进行LDAP查询,因此它似乎正在起作用,只是导致所有测试都出错。
之前有人见过这个吗?
答案 0 :(得分:2)
rake
是否在与gem
相同的Ruby环境中运行?您是否指定了正确的lib
目录?
config.gem 'ruby-net-ldap', :version => '0.0.4', :lib => 'net/ldap'