在雪豹上安装link-parser gem的问题 [英] problems on installing link-parser gem on snow leopard

查看:183
本文介绍了在雪豹上安装link-parser gem的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使链接解析器gem在我的雪豹上工作。



当我试图做'sudo gem install linkparser'时,我得到:

 构建原生扩展。这可能需要一段时间... 
错误:安装linkparser时出错:
错误:无法构建gem本机扩展。

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
检查pkg-config ...否
** * extconf.rb失败***
由于某种原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--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:找不到你的pkg-config二进制文件(RuntimeError )


Gem文件将被安装在/Library/Ruby/Gems/1.8/gems/linkparser-1.1.0中进行检查。
结果记录到/Library/Ruby/Gems/1.8/gems/linkparser-1.1.0/ext/gem_make.out

当我从源代码编译链接语法4.3.5后,尝试做'rake':

 任务库'rake / manual.rb'加载失败:NameError:未初始化的常量MANUALDIR。有些任务可能无法使用。 
没有DarkFish:LoadError:没有这样的文件加载 - darkfish-rdoc
任务库'rake / rdoc.rb'加载失败:NameError:未初始化的常量RDOCDIR。有些任务可能无法使用。
任务库'rake / testing.rb'未能加载:NameError:未初始化的常量Spec。有些任务可能无法使用。
rm -r coverage
rake clean
(在/ 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
(在/ 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字典。 o linkage.o linkparser.o parseoptions.o sentence.o -lpthread -ldl -llink-grammar -lruby
ld:warning:在/usr/local/lib/liblink-grammar.dylib中,文件是为不支持的文件格式不是被链接的体系结构(i386)
没有定义规范任务:没有要加载的文件 - spec / rake / spectask
rake中止!
不知道如何构建任务'rdoc'

如何解决这个问题?在编译链接语法时,是否有任何特殊的编译选项需要指定? 解决方案

看起来您需要安装< a href =http://pkg-config.freedesktop.org/wiki/ =nofollow> pkg-config 。



d建议首先安装 XCode (如果您尚未),请安装它,然后 Homebrew (OS X的包管理器),然后运行 brew install pkg-config 在终端中。



如果您已安装MacPorts或Fink,我相信您可以在其存储库中找到相应的软件包还有。

I cannot make link-parser gem working on my snow leopard.

When I tried to do 'sudo gem install linkparser' and I get:

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

When I compiled link-grammar 4.3.5 from source (it went well) and then tried to do 'rake':

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'

How to fix this? Is there any special compiling options I need to specify when I compile link-grammar?

解决方案

It looks like you need to install pkg-config.

I'd recommend installing it by first installing XCode (if you haven't already), then Homebrew (a package manager for OS X), and then running brew install pkg-config in the terminal.

If you already have MacPorts or Fink installed I'm sure you can find the appropriate package in their repositories as well.

这篇关于在雪豹上安装link-parser gem的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆