簡體   English   中英

使用本機擴展構建gem(Gem :: Installer :: ExtensionBuildError)

[英]Build a gem with native extension (Gem::Installer::ExtensionBuildError)

我有以下配置:

  • uname -a: Linux 2.6.24.2 i686 GNU / Linux(Ubuntu)
  • ruby -v: ruby 1.9.0(2007-12-25修訂版14709)[i486-linux]
  • rails -v: Rails 3.0.0.beta3
  • gem -v :1.3.5
  • rake --version: rake,版本0.8.7
  • make -v: GNU Make 3.81
  • 寶石環境:
    • RUBYGEMS版本:1.3.5
    • RUBY版本:1.9.0(2007-12-25補丁級別0)[i486-linux]
    • 安裝目錄:/usr/lib/ruby1.9/gems/1.9.0
    • RUBY EXECUTABLE:/usr/bin/ruby1.9
    • 可執行的目錄:/ usr / bin
    • RUBYGEMS PLATFORMS:
    • 紅寶石
    • x86架構的Linux
    • 創業板路徑:
      • /usr/lib/ruby1.9/gems/1.9.0
      • /root/.gem/ruby/1.9.0
    • 創業板配置:
      • :update_sources => true
      • :verbose => true
      • :benchmark => false
      • :backtrace => false
      • :bulk_threshold => 1000
    • 遠程來源:

當我嘗試這個簡單的命令:

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

事實上,每當我嘗試安裝具有原生擴展名的gem時 ,我都會遇到相同類型的錯誤。

這會給任何人敲響聲嗎?

似乎Nokogiri問題#116說明了一切:

不支持Ruby 1.9.0 你應該升級到1.9.1-p129甚至1.9.2。 1.9.0太破碎了,無法支持。 :-(

我現在想要更新這個小紅寶石的東西......

對於nokogiri,你可以在這里嘗試一下

對於其他寶石,您可以在此處查看ruby 1.9兼容性問題

暫無
暫無

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

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