我正在尝试安装ruby-ldap但它不起作用。
尝试安装libsasl2-dev和libldap-dev没有帮助。
尝试apt-get install ruby-ldap
gem忽略它。
尝试删除/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
答案 0 :(得分:2)
您gcc
编译器似乎是太生气警告。您是否会尝试在编译期间强制执行格式检查:
gem install ruby-ldap -- --with-cflags=\"-Wformat=0\"
后者应覆盖由CFLAGS
维护者提供的默认ruby-ldap
,并停止将格式警告视为错误。如果这样做无效,您可以下载ruby-ldap
的来源,找到原始扩展程序的Makefile
,然后从中删除-Werror=format-security
字符串。
希望它有所帮助。