简体   繁体   English

优胜美地-SQLite3 gem安装错误-不支持C扩展

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

I want to use SQLite3 in a jruby project. 我想在jruby项目中使用SQLite3。

gem install SQLite3

command fails with 命令失败

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 version gcc版本

which gcc => /usr/bin/gcc

trying to install SQLite3 试图安装SQLite3

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

SQLite3 version installed 已安装SQLite3版本

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

i thinks this is the culprit. 我认为这是罪魁祸首。 It probably points to the Android version of SQLite3 instead of a system one and that's why it fails to build the native extension. 它可能指向SQLite3的Android版本,而不是系统版本,这就是为什么它无法构建本机扩展的原因。

You appear to be using JRuby , not the standard Ruby implementation, Ruby MRI . 您似乎正在使用JRuby ,而不是标准的Ruby实现Ruby MRI

The SQLite3 gem relies on Ruby C extensions, but unlike the standard implementation, JRuby does not support Ruby C extensions : SQLite3 gem依赖于Ruby C扩展,但是与标准实现不同, JRuby不支持Ruby C扩展

JRuby versions prior to 1.6 did not support Ruby C extensions, and even in 1.6 the support is still "in development" and considered experimental. 1.6之前的JRuby版本不支持Ruby C扩展,甚至在1.6中,该支持仍在“开发中”并被认为是试验性的。 As of 1.7, it has been disabled and will likely be removed . 从1.7开始,它已被禁用,可能会被删除

The article above lists recommendations to alternative gems, including for SQLite3. 上面的文章列出了其他替代宝石的建议,包括针对SQLite3的宝石。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM