簡體   English   中英

優勝美地-SQLite3 gem安裝錯誤-不支持C擴展

[英]Yosemite - SQLite3 gem installation error - C extensions not supported

我想在jruby項目中使用SQLite3。

gem install SQLite3

命令失敗

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

    /Users/h1k3n/.rvm/rubies/jruby-9.0.0.0/bin/jruby -r ./siteconf20150809-4559-7o84f5.rb extconf.rb
NotImplementedError: C extensions are not supported
    <top> at /Users/h1k3n/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/mkmf.rb:1
  require at org/jruby/RubyKernel.java:940
   (root) at /Users/h1k3n/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
    <top> at extconf.rb:3

extconf failed, exit code 1

Gem files will remain installed in /Users/h1k3n/.rvm/gems/jruby-9.0.0.0/gems/sqlite3-1.3.10 for inspection.
Results logged to /Users/h1k3n/.rvm/gems/jruby-9.0.0.0/extensions/universal-java-1.8/2.2.0/sqlite3-1.3.10/gem_make.out

gcc版本

which gcc => /usr/bin/gcc

試圖安裝SQLite3

brew instal SQLite3 => Warning: sqlite-3.8.11 already installed

已安裝SQLite3版本

which SQLite3 => ~/Android/sdk/platform-tools/sqlite3

我認為這是罪魁禍首。 它可能指向SQLite3的Android版本,而不是系統版本,這就是為什么它無法構建本機擴展的原因。

您似乎正在使用JRuby ,而不是標准的Ruby實現Ruby MRI

SQLite3 gem依賴於Ruby C擴展,但是與標准實現不同, JRuby不支持Ruby C擴展

1.6之前的JRuby版本不支持Ruby C擴展,甚至在1.6中,該支持仍在“開發中”並被認為是試驗性的。 從1.7開始,它已被禁用,可能會被刪除

上面的文章列出了其他替代寶石的建議,包括針對SQLite3的寶石。

暫無
暫無

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

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