Ubuntu 上的 sqlite3-ruby 安装错误

2021-12-03 00:00:00 ubuntu ruby sqlite sqlite3-ruby

我在 sqlite3-ruby 安装过程中出现以下错误:

<前>构建本机扩展.这可能需要一段时间...错误:安装 sqlite3-ruby 时出错:错误:无法构建 gem 本机扩展./usr/bin/ruby1.8 extconf.rb检查 sqlite3.h... 没有缺少 sqlite3.h.尝试port install sqlite3 +universal"或yum install sqlite3-devel"*** extconf.rb 失败 ***由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件.查看 mkmf.log 文件了解更多信息细节.您可能需要配置选项.提供的配置选项:--with-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=/usr/bin/ruby1.8--with-sqlite3-dir--without-sqlite3-dir--with-sqlite3-include--without-sqlite3-include=${sqlite3-dir}/include--with-sqlite3-lib--without-sqlite3-lib=${sqlite3-dir}/libGem 文件将保留安装在/usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1 中以供检查.结果记录到/usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out

sqlite3.h 位于/usr/include/

<前>sudo gem 安装 sqlite3-ruby --without-sqlite3-include=/usr/include

不起作用

<前>错误:执行 gem 时 ... (OptionParser::InvalidOption)无效选项:--without-sqlite3-include=/usr/include

Ubuntu 10.04

解决方案

您需要 SQLite3 开发头文件,以便 gem 的本机扩展进行编译.您可以通过运行(可能使用 sudo)来安装它们:

apt-get install libsqlite3-dev

I have the following error during sqlite3-ruby install:

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

/usr/bin/ruby1.8 extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel'
*** 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=/usr/bin/ruby1.8
    --with-sqlite3-dir
    --without-sqlite3-dir
    --with-sqlite3-include
    --without-sqlite3-include=${sqlite3-dir}/include
    --with-sqlite3-lib
    --without-sqlite3-lib=${sqlite3-dir}/lib


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out

sqlite3.h is located in /usr/include/

sudo gem install sqlite3-ruby --without-sqlite3-include=/usr/include

doesn't work


ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --without-sqlite3-include=/usr/include

Ubuntu 10.04

解决方案

You need the SQLite3 development headers for the gem’s native extension to compile against. You can install them by running (possibly with sudo):

apt-get install libsqlite3-dev

相关文章