2011-02-25 27 views
0

我無法使鏈接解析器寶石在我的雪豹上工作。關於在雪豹上安裝鏈接解析器寶石的問題

當我嘗試做「sudo的創業板安裝linkparser」,我得到:

Building native extensions. This could take a while... 
ERROR: Error installing linkparser: 
    ERROR: Failed to build gem native extension. 

     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
checking for pkg-config... no 
*** 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. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 
    --with-link-grammar 
    --without-link-grammar 
    --with-pkg-config 
    --without-pkg-config 
extconf.rb:18: Couldn't find your pkg-config binary (RuntimeError) 


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/linkparser-1.1.0 for inspection. 
Results logged to /Library/Ruby/Gems/1.8/gems/linkparser-1.1.0/ext/gem_make.out 

當我編譯鏈接語法4.3.5從源代碼(很順利),然後嘗試做「耙」 :

Task library 'rake/manual.rb' failed to load: NameError: uninitialized constant MANUALDIR. Some tasks may not be available. 
No DarkFish: LoadError: no such file to load -- darkfish-rdoc 
Task library 'rake/rdoc.rb' failed to load: NameError: uninitialized constant RDOCDIR. Some tasks may not be available. 
Task library 'rake/testing.rb' failed to load: NameError: uninitialized constant Spec. Some tasks may not be available. 
rm -r coverage 
rake clean 
(in /Users/alan/linkparser/ext) 
rm -r dictionary.o 
rm -r linkage.o 
rm -r linkparser.o 
rm -r parseoptions.o 
rm -r sentence.o 
rake 
(in /Users/alan/linkparser/ext) 
gcc -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -Wall -DDEBUG -DHAVE_LINK_GRAMMAR_LINK_INCLUDES_H -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/Library/Ruby/Site/1.8 -I. -c dictionary.c 
gcc -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -Wall -DDEBUG -DHAVE_LINK_GRAMMAR_LINK_INCLUDES_H -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/Library/Ruby/Site/1.8 -I. -c linkage.c 
gcc -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -Wall -DDEBUG -DHAVE_LINK_GRAMMAR_LINK_INCLUDES_H -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/Library/Ruby/Site/1.8 -I. -c linkparser.c 
gcc -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -Wall -DDEBUG -DHAVE_LINK_GRAMMAR_LINK_INCLUDES_H -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/Library/Ruby/Site/1.8 -I. -c parseoptions.c 
gcc -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -Wall -DDEBUG -DHAVE_LINK_GRAMMAR_LINK_INCLUDES_H -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/Library/Ruby/Site/1.8 -I. -c sentence.c 
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -o linkparser_ext.bundle dictionary.o linkage.o linkparser.o parseoptions.o sentence.o -lpthread -ldl -llink-grammar -lruby 
ld: warning: in /usr/local/lib/liblink-grammar.dylib, file was built for unsupported file format which is not the architecture being linked (i386) 
Specification tasks not defined: no such file to load -- spec/rake/spectask 
rake aborted! 
Don't know how to build task 'rdoc' 

如何解決這個問題?編譯鏈接語法時是否需要指定特殊的編譯選項?

回答

3

看起來您需要安裝pkg-config

我建議先安裝XCode(如果還沒有的話),然後Homebrew(OS X的包管理器),然後在終端中運行brew install pkg-config來安裝它。

如果您已安裝MacPorts或Fink,我相信您也可以在其存儲庫中找到相應的軟件包。

+0

謝謝。我通過macport安裝。然後它抱怨鏈接語法版本太舊了。然後我下載了最新的源代碼(4.7.1)並重新編譯。它的作品~~~整齊! – lkahtz 2011-02-25 05:44:36

+0

當然希望在Windows中有一個簡單的方法來做到這一點。我真的需要linkparser gem,我希望它不依賴於pkg-config – Arcolye 2011-09-12 08:43:43