简体   繁体   English

安装Nokogiri-xmlsec-me-harder Mac El Capitan时出错

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

get this error when doing bundle install: 进行捆绑安装时出现此错误:

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

I've tried all the different suggestions for installing nokigori but none worked so I tried: 我已经尝试过安装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

Only showing beginning and end of mkmf.log for space reasons. 由于空间原因,仅显示mkmf.log的开头和结尾。 How can I fix this? 我怎样才能解决这个问题?

I had the same issue on EL Capitan and my fix was to: 我在EL Capitan上遇到了同样的问题,我的解决方法是:

brew install libxmlsec1

after which bundle install worked. 之后bundle install

I faced it myself and this one isn't easy. 我自己面对过,这并不容易。

First there is a typo in /usr/local/Cellar/libxmlsec1/1.2.20_1/include/xmlsec1/xmlsec/templates.h 首先在/usr/local/Cellar/libxmlsec1/1.2.20_1/include/xmlsec1/xmlsec/templates.h中有一个错字

Line 12, you have to replace __XMLSEC_TEMPALTES_H__ by __XMLSEC_TEMPLATES_H__ 第12行,您必须将__XMLSEC_TEMPALTES_H__替换为__XMLSEC_TEMPLATES_H__

I then faced another issue (I think due to a XCode 8 bug...): ld: file not found: /usr/lib/system/libsystem_symptoms.dylib for architecture x86_64 然后,我遇到另一个问题(我认为是由于XCode 8错误...): ld: file not found: /usr/lib/system/libsystem_symptoms.dylib for architecture x86_64

I found this answer: libsystem_symptoms.dylib missing in Xcode 8 我找到了这个答案: Xcode 8中缺少libsystem_symptoms.dylib

But the first solution cannot be used here and the second one didn't work. 但是第一种解决方案无法在此处使用,第二种解决方案无效。 So I went to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/lib and performed my own sed: 所以我去了/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, / /"

This command will create backup files (with .backup extension) for each modified file in case something goes wrong. 如果出现问题,此命令将为每个修改的文件创建备份文件(扩展名为.backup)。

Only then nokogiri-xmlsec-me-harder could be installed. 只有这样,才能安装nokogiri-xmlsec-me-harder。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM