簡體   English   中英

安裝Nokogiri-xmlsec-me-harder Mac El Capitan時出錯

[英]Error installing Nokogiri-xmlsec-me-harder Mac El Capitan

進行捆綁安裝時出現此錯誤:

An error occurred while installing nokogiri-xmlsec-me-harder (0.9.3pre), and
Bundler cannot continue.

我已經嘗試過安裝nokigori的所有不同建議,但是都沒有奏效,所以我嘗試了:

gem install nokogiri-xmlsec-me-harder

Fetching: nokogiri-xmlsec-me-harder-0.9.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri-xmlsec-me-harder:
    ERROR: Failed to build gem native extension.

    current directory: /Users/sylviaalowden/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/nokogiri-xmlsec-me-harder-0.9.2/ext/nokogiri_ext_xmlsec
/Users/sylviaalowden/.rvm/rubies/ruby-2.3.1/bin/ruby -r ./siteconf20160921-62548-1ly6yoh.rb extconf.rb
checking for ruby.h... yes
Clfags: $(cflags)  -fno-common -pipe -DXMLSEC_CRYPTO=\"openssl\" -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_OPENSSL_100=1 -DXMLSEC_CRYPTO_OPENSSL=1 -fvisibility=hidden
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/sylviaalowden/.rvm/gems/ruby-2.3.1@global/extensions/x86_64-darwin-15/2.3.0/nokogiri-xmlsec-me-harder-0.9.2/mkmf.log

current directory: /Users/sylviaalowden/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/nokogiri-xmlsec-me-harder-0.9.2/ext/nokogiri_ext_xmlsec
make "DESTDIR=" clean

current directory: /Users/sylviaalowden/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/nokogiri-xmlsec-me-harder-0.9.2/ext/nokogiri_ext_xmlsec
make "DESTDIR="
compiling init.c
In file included from init.c:1:
In file included from ./xmlsecrb.h:19:
/usr/local/Cellar/libxmlsec1/1.2.20_1/include/xmlsec1/xmlsec/templates.h:11:9: warning: '__XMLSEC_TEMPLATES_H__' is used as a header guard here, followed by #define of a different macro [-Wheader-guard]
#ifndef __XMLSEC_TEMPLATES_H__
        ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/libxmlsec1/1.2.20_1/include/xmlsec1/xmlsec/templates.h:12:9: note: '__XMLSEC_TEMPALTES_H__' is defined here; did you mean '__XMLSEC_TEMPLATES_H__'?
#define __XMLSEC_TEMPALTES_H__
        ^~~~~~~~~~~~~~~~~~~~~~
        __XMLSEC_TEMPLATES_H__
1 warning generated.
compiling nokogiri_decrypt_with_key.c
In file included from nokogiri_decrypt_with_key.c:1:
In file included from ./xmlsecrb.h:19:
/usr/local/Cellar/libxmlsec1/1.2.20_1/include/xmlsec1/xmlsec/templates.h:11:9: warning: '__XMLSEC_TEMPLATES_H__' is used as a header guard here, 
........................
/usr/local/Cellar/libxmlsec1/1.2.20_1/include/xmlsec1/xmlsec/templates.h:12:9: note: '__XMLSEC_TEMPALTES_H__' is defined here; did you mean '__XMLSEC_TEMPLATES_H__'?
#define __XMLSEC_TEMPALTES_H__
        ^~~~~~~~~~~~~~~~~~~~~~
        __XMLSEC_TEMPLATES_H__
1 warning generated.
linking shared-object nokogiri_ext_xmlsec.bundle
ld: file not found: /usr/lib/system/libsystem_symptoms.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [nokogiri_ext_xmlsec.bundle] Error 1

make failed, exit code 2

由於空間原因,僅顯示mkmf.log的開頭和結尾。 我怎樣才能解決這個問題?

我在EL Capitan上遇到了同樣的問題,我的解決方法是:

brew install libxmlsec1

之后bundle install

我自己面對過,這並不容易。

首先在/usr/local/Cellar/libxmlsec1/1.2.20_1/include/xmlsec1/xmlsec/templates.h中有一個錯字

第12行,您必須將__XMLSEC_TEMPALTES_H__替換為__XMLSEC_TEMPLATES_H__

然后,我遇到另一個問題(我認為是由於XCode 8錯誤...): ld: file not found: /usr/lib/system/libsystem_symptoms.dylib for architecture x86_64

我找到了這個答案: Xcode 8中缺少libsystem_symptoms.dylib

但是第一種解決方案無法在此處使用,第二種解決方案無效。 所以我去了/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/lib並執行了自己的sed:

grep -irl /usr/lib/system/libsystem_symptoms.dylib * | xargs sudo /usr/bin/sed -i.backup -e"s/\\/usr\\/lib\\/system\\/libsystem_symptoms.dylib, / /"

如果出現問題,此命令將為每個修改的文件創建備份文件(擴展名為.backup)。

只有這樣,才能安裝nokogiri-xmlsec-me-harder。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM