2013-04-02 92 views
0

我正在嘗試安裝ruby-ldap,但它不起作用。在Debian中安裝ruby-ldap時出錯

嘗試安裝libsasl2-dev和libldap-dev沒有幫助。

試過apt-get install ruby-ldap寶石忽略它。

嘗試刪除/var/lib/gems/1.9.1/gems/ruby-ldap* & /var/lib/gems/1.9.1/cache/ruby-ldap*重新安裝並沒有幫助。

任何人都有類似的問題?

# gem install ruby-ldap 
Fetching: ruby-ldap-0.9.12.gem (100%) 
Building native extensions. This could take a while... 
ERROR: Error installing ruby-ldap: 
     ERROR: Failed to build gem native extension. 

     /usr/bin/ruby1.9.1 extconf.rb 
--with-openldap2 
checking for ldap.h... yes 
checking for lber.h... yes 
checking for ldap_ssl.h... no 
checking for openssl/ssl.h... yes 
checking for openssl/crypto.h... yes 
checking for main() in -lcrypto... yes 
checking for main() in -lssl... yes 
checking for main() in -lnsl... yes 
checking for main() in -lpthread... yes 
checking for main() in -lresolv... yes 
checking for main() in -llber... yes 
checking for main() in -lldap_r... yes 
checking for main() in -lldap... yes 
checking for ldap_init() in ldap.h... yes 
checking for ldap_set_option()... yes 
checking for ldap_get_option()... yes 
checking for ldap_start_tls_s()... yes 
checking for ldap_memfree()... yes 
checking for ldap_perror()... yes 
checking for ldap_sort_entries()... yes 
checking for ldapssl_init()... no 
checking for ldap_sslinit()... no 
checking for ldap_sasl_bind_s()... yes 
checking for ldap_compare_s()... yes 
checking for ldap_add_ext_s()... yes 
checking for ldap_compare_ext_s()... yes 
checking for ldap_delete_ext_s()... yes 
checking for ldap_modify_ext_s()... yes 
checking for ldap_search_ext_s()... yes 
checking for ldap_unbind_ext_s()... yes 
checking for ldap_sasl_interactive_bind_s()... yes 
creating Makefile 

make 
compiling saslconn.c 
saslconn.c: In function ‘rb_ldap_conn_sasl_bind’: 
saslconn.c:178:7: error: format not a string literal and no format arguments [-Werror=format-security] 
saslconn.c:200:7: error: format not a string literal and no format arguments [-Werror=format-security] 
cc1: some warnings being treated as errors 
make: *** [saslconn.o] Error 1 

回答

2

您的gcc編譯器似乎太警惕了。你會嘗試在編譯過程中執行不格式檢查:

gem install ruby-ldap -- --with-cflags=\"-Wformat=0\" 

後者應覆蓋默認CFLAGS,通過ruby-ldap維護供應,並停止治療格式警告視爲錯誤。如果這樣做沒有幫助,你總是可以下載ruby-ldap的源代碼,找到原生擴展的Makefile並從那裏刪除-Werror=format-security字符串。

希望它有幫助。

+0

是的,它是aparenty [this](http://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_FORMAT_.28gcc.2Fg.2B-.2B-_-Wformat_-Wformat-security_-Werror.3Dformat-security。 29)是雷森。非常感謝!! – aza