无法在 Amazon Linux 上安装 sqlite3 gem(已安装 ruby 和 sqlite 的开发库)
我正在运行一个基于 ami-595a0a1c 构建的实例,它是 Amazon 的定制 Linux。我正在尝试安装 sqlite3(或 sqlite)gem,但失败并出现以下错误:
$ sudo gem install sqlite3 构建本机扩展。这可能需要一段时间... 错误:安装 sqlite3 时出错: 错误:无法构建 gem 本机扩展。 /usr/bin/ruby extconf.rb 检查 sqlite3.h...否 sqlite3.h 丢失。尝试“端口安装 sqlite3 +通用” 或“yum install sqlite3-devel”并检查您的共享库搜索路径
( sqlite3 共享库所在的位置)。 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 --没有 make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby --with-sqlite3-dir --没有-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib Gem 文件将保留安装在 /usr/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3 中以供检查。结果记录到 /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 update --system
$ sudo gem 安装rails
$rails 新应用
$ cd 应用程序
$rails 服务器
在 Gemfile 中列出的任何 gem 源中都找不到 gem 'sqlite3 (>= 0)'。
$ sudo yum install sqlite-devel
$ sudo gem install sqlite(或 sqlite3——相同的结果)
请参阅上面的损坏。请注意 - 我确实意识到我可以注释掉 gemfile 中的行以使 Rails 运行,但我实际上需要 gem。提前致谢!
I'm running an instance built off ami-595a0a1c which is Amazon's customized Linux. I am trying to install the sqlite3 (or sqlite) gem and it's failing with the below error:
$ 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
(the
location where your sqlite3 shared library is located).
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/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
Typically, this just means you need to install the development libraries and everything is cool. However, I have installed the sqlite-devel packages and still no dice. Since this is the Amazon Linux instance, I'd rather not add more repositories than the ones Amazon provides if possible. What can i do to get this thing to compile? Thanks for any insight!
From a brand new instance, here's what I've done:
$ sudo yum install rubygems ruby-devel
$ sudo gem update --system
$ sudo gem install rails
$ rails new app
$ cd app
$ rails server
Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile.
$ sudo yum install sqlite-devel
$ sudo gem install sqlite (or sqlite3 -- same result)
See breakage above. And note - I do realize I can comment out the line in the gemfile to get rails to run but I actually need the gem. Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也遇到了这个。令人惊讶的是,库存的 amazon linux 没有安装 make 或 gcc。
Ran into this as well. Surprisingly the stock amazon linux doesn't have make or gcc installed.
请注意版本3。
或者,如果您的操作系统中提供了该软件包,请安装
libsqlite3-ruby
Note the version 3.
Or if the package is available in your OS install
libsqlite3-ruby