2010-05-20 115 views
5

我有以下配置:建立与本地扩展宝石(宝石::安装:: ExtensionBuildError)

  • UNAME -a:的Linux 2.6.24.2的i686的GNU/Linux(Ubuntu的)
  • 红宝石-v:红宝石1.9.0(2007-12-25的修订14709)[1486-的linux]
  • 导轨-v:导轨3.0.0.beta3
  • 宝石-v:1.3.5
  • 耙--version:耙,版本0.8.7
  • 使-v: GNU使3.81
  • 宝石ENV:
    • RubyGems的版本:1.3 .5
    • RUBY VERSION:1.9.0(2007-12-25 patchlevel 0)[i486-linux]
    • 安装目录:/usr/lib/ruby1.9/gems/1.9.0
    • Ruby可执行文件:/usr/bin/ruby1.9
    • 可执行文件目录:在/ usr/bin中
    • RubyGems的平台:
    • 红宝石
    • x86的Linux的
    • GEM PATHS:
      • /usr/lib/ruby1.9/gems/1.9.0
      • /root/.gem/ruby/1.9.0
    • GEM CONFIGURATION:
      • :update_sources =>真
      • :冗长=>真
      • :基准=>假
      • :回溯=>假
      • :bulk_threshold => 1000
    • REMOTE SOURCES:

当我试试这个简单的命令:

gem install nokogiri 

这里是我所得到的:

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

/usr/bin/ruby1.9 extconf.rb 
checking for iconv.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes 
checking for libxml/parser.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes 
checking for libxslt/xslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes 
checking for libexslt/exslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes 
checking for xmlParseDoc() in -lxml2... yes 
checking for xsltParseStylesheetDoc() in -lxslt... yes 
checking for exsltFuncRegister() in -lexslt... yes 
checking for xmlRelaxNGSetParserStructuredErrors()... yes 
checking for xmlRelaxNGSetParserStructuredErrors()... yes 
checking for xmlRelaxNGSetValidStructuredErrors()... yes 
checking for xmlSchemaSetValidStructuredErrors()... yes 
checking for xmlSchemaSetParserStructuredErrors()... yes 
creating Makefile 

make 
cc -I. -I/usr/include/libxml2 -I/usr/include -I/usr/include/ruby-1.9.0/i486-linux -I/usr/include/ruby-1.9.0 -I. -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETPARSERSTRUCTUREDERRORS -I/opt/local/include/ -I/opt/local/include/libxml2 -I/opt/local/include -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -fPIC -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -o xml_document_fragment.o -c xml_document_fragment.c 
In the included file starting at ./nokogiri.h:75, 
      From ./xml_document_fragment.h:4, 
      From xml_document_fragment.c:1: 
./xml_document.h:5:16: error: st.h : No file or folder with this type 
make: *** [xml_document_fragment.o] Error 1 


Gem files will remain installed in /usr/lib/ruby1.9/gems/1.9.0/gems/nokogiri-1.4.1 for inspection. 
Results logged to /usr/lib/ruby1.9/gems/1.9.0/gems/nokogiri-1.4.1/ext/nokogiri/gem_make.out 

的 “gem_make.out” 文件包含与上面描述的完全相同的信息。

如果我尝试用另一颗宝石:

gem install gherkin 

这里是我所得到的:

 
u# gem install gherkin 
Building native extensions. This could take a while... 
ERROR: Error installing gherkin: 
     ERROR: Failed to build gem native extension. 

/usr/bin/ruby1.9 extconf.rb 
checking for main() in -lc... yes 
creating Makefile 

make 
cc -I. -I/usr/include/ruby-1.9.0/i486-linux -I/usr/include/ruby-1.9.0 -I. -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -fPIC -o gherkin_lexer_ar.o -c gherkin_lexer_ar.c 
/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/ar.c.rl:11:16: erreur: re.h : Aucun fichier ou dossier de ce type 
make: *** [gherkin_lexer_ar.o] Erreur 1 


Gem files will remain installed in /usr/lib/ruby1.9/gems/1.9.0/gems/gherkin-1.0.30 for inspection. 
Results logged to /usr/lib/ruby1.9/gems/1.9.0/gems/gherkin-1.0.30/ext/gherkin_lexer_ar/gem_make.out 

其实每当我试图安装宝石原生扩展,我得到相同错误类型。

这会给任何人敲钟吗?

回答

1

看来,Issue #116 of Nokogiri说,这一切:

Ruby 1.9的。 0不支持。你应该升级到1.9.1-p129甚至1.9.2。 1.9.0太破碎了,无法支持。 :-(

我现在可能要更新这个小红宝石的事情...

+1

嗯,我从源代码安装了Ruby 1.9.1感谢这篇博文:http://rudygems.com/post/99075288/ruby-191-install 现在它可以无缝工作。 – 2010-05-28 18:43:08

0

对于引入nokogiri你可以给一个尝试here

对于其他宝石,你可以check here为Ruby 1.9的兼容性问题

+0

你提出的是得到它在Mac OS environements安装。我曾尝试与源安装创业板引入nokogiri页,但它并没有诀窍 我不确定这个问题是关于Ruby 1.9的兼容性,因为我可以将它全部安装在我的Windows工作站上,但不在Ubuntu服务器上。 我向其他人开放主张,但 – 2010-05-20 12:52:26