gpt4 book ai didi

ruby - 无法在 Amazon Linux 上安装 sqlite3 gem(已经安装了 ruby​​ 和 sqlite 的开发库)

转载 作者:数据小太阳 更新时间:2023-10-29 08:06:08 25 4
gpt4 key购买 nike

我正在运行一个基于 ami-595a0a1c 构建的实例,它是亚马逊的定制 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

(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

通常,这只意味着您需要安装开发库,一切都很好。但是,我已经安装了 sqlite-devel 包,但仍然没有骰子。由于这是 Amazon Linux 实例,如果可能的话,我不想添加比 Amazon 提供的存储库更多的存储库。我该怎么做才能编译这个东西?感谢您的任何见解!

在一个全新的实例中,这是我所做的:

$ 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)

见上面的破损。并注意 - 我确实意识到我可以注释掉 gemfile 中的行以使 rails 运行但我实际上需要 gem。提前致谢!

最佳答案

也遇到了这个。令人惊讶的是,库存的亚马逊 Linux 没有安装 make 或 gcc。

sudo yum install gcc
sudo yum install make

关于ruby - 无法在 Amazon Linux 上安装 sqlite3 gem(已经安装了 ruby​​ 和 sqlite 的开发库),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5253979/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com