Can';t在Windows/Cygwin下安装ruby ldap

Can';t在Windows/Cygwin下安装ruby ldap,ruby,installation,gem,Ruby,Installation,Gem,gem安装ruby ldap Building native extensions. This could take a while... ERROR: Error installing ruby-ldap: ERROR: Failed to build gem native extension. /usr/bin/ruby.exe extconf.rb --with-ldap-dir=/usr --with-openldap2 checking for

gem安装ruby ldap

Building native extensions.  This could take a while...
ERROR:  Error installing ruby-ldap:
         ERROR: Failed to build gem native extension.

         /usr/bin/ruby.exe extconf.rb
--with-ldap-dir=/usr
--with-openldap2
checking for ldap.h... yes
[...]
creating Makefile

make
gcc -I. -I. -I/usr/lib/ruby/1.8/i386-cygwin -I. ...
[...]
gcc -shared -s -o ldap.so ...
配置和编译工作正常。但安装会引发以下错误:

make install
/usr/bin/install -c -m 0755 ldap.so /usr/lib/ruby/gems/1.8/gems/ruby-ldap-0.9.12/lib
/usr/bin/install -c -m 644 ./lib/ldap/control.rb /usr/lib/ruby/gems/1.8/gems/ruby-ldap-0.9.12/lib/ldap
/usr/bin/install: `./lib/ldap/control.rb' and `/usr/lib/ruby/gems/1.8/gems/ruby-ldap-0.9.12/lib/ldap/control.rb' are the same file
Makefile:130: recipe for target `/usr/lib/ruby/gems/1.8/gems/ruby-ldap-0.9.12/lib/ldap/control.rb' failed
make: *** [/usr/lib/ruby/gems/1.8/gems/ruby-ldap-0.9.12/lib/ldap/control.rb] Error 1
/lib/ldap/control.rb
/usr/lib/ruby/gems/1.8/gems/ruby-ldap-0.9.12/lib/ldap/control.rb
确实是同一个文件,但为什么呢?其他带有nativ绑定的gem,比如
mysql
,工作得很好。我报告这是一个bug,但是其他人没有这个问题,所以包本身是完整的

如果我下载gem并运行:

ruby extconf.rb
make install
生成文件运行正常。
它必须是我的系统/配置。这里出了什么问题?

哇,非常奇怪的是,我通过降低RubyGems的等级,然后将其重新升级,使其正常工作。我首先将其降级,以匹配我在另一个可以安装ruby ldap的系统上的版本(1.4.1)。我想这可能会使它在我当前的系统上工作,但我得到了与您相同的错误。我将RubyGems升级回我所拥有的(1.8.15),然后它神奇地工作了

因此:


仅供参考,我不必使用sudo,因为我使用的是rvm,并且我将ruby ldap安装到每个项目的gemset中。

如果您使用的是Ubunty,请尝试执行以下操作

  sudo apt-get install libsasl2-dev

关于它的更多信息,请访问

我也有完全相同的问题,但是在Ubuntu 10.04上。所有其他gems安装都很好,但这一个有“control.rb是同一个文件”。令人沮丧!抱歉,这不适用于我:(在关闭/升级rubygems后出现相同问题。
  sudo apt-get install libsasl2-dev