【发布时间】:2011-07-12 08:35:01
【问题描述】:
我正在运行一个基于 ami-595a0a1c 构建的实例,它是 Amazon 的定制 Linux。我正在尝试安装 sqlite3(或 sqlite)gem,但失败并出现以下错误:
$ sudo gem install sqlite3 Building native extensions. This could take a while... ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel' and check your shared library search path( 您的 sqlite3 共享库所在的位置)。 extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺少 必要的库和/或头文件。检查 mkmf.log 文件 更多的 细节。您可能需要配置选项。
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/ruby --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/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3 for inspection. Results logged to /usr/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out
通常,这只是意味着您需要安装开发库,一切都很酷。但是,我已经安装了 sqlite-devel 包,但仍然没有骰子。由于这是 Amazon Linux 实例,因此如果可能,我宁愿不要添加比 Amazon 提供的存储库更多的存储库。我该怎么做才能编译这个东西?感谢您的任何见解!
在一个全新的实例中,这是我所做的:
$ sudo yum install rubygems ruby-devel
$ sudo gem 更新 --system
$ sudo gem install rails
$ rails 新应用程序
$ cd 应用程序
$ 导轨服务器
在您的 Gemfile 中列出的任何 gem 源中都找不到 gem 'sqlite3 (>= 0)'。
$ sudo yum install sqlite-devel
$ sudo gem install sqlite(或 sqlite3 -- 结果相同)
见上面的破损。请注意 - 我确实意识到我可以注释掉 gemfile 中的行以让 rails 运行,但我实际上需要 gem。提前致谢!
【问题讨论】: