簡體   English   中英

在El Capitan上安裝Rails時找不到-lgmp錯誤的庫(Mac OS 10.11.1(15B42))

[英]library not found for -lgmp error when installing Rails on El Capitan ( Mac OS 10.11.1 (15B42))

在Ruby v2.2.2上在El Capitan(Mac OS X 10.11.1)上安裝Rails時,出現以下錯誤:

ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

    /Users/jon/.rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20151117-26799-ux15fd.rb extconf.rb --use-system-libraries
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

並且mkmf.log文件具有:

$ cat /Users/jon/.rvm/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/nokogiri-1.6.6.3/mkmf.log 
"gcc -o conftest -I/Users/jon/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-darwin14 ...
-lruby.2.2.0  -lpthread -lgmp -ldl -lobjc  "
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

固定

xcode-select --install

並重新運行gem install rails工作。

暫無
暫無

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

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