【问题标题】:Issue with 'gem install sqlite3-ruby' on RHEL6RHEL6 上的“gem install sqlite3-ruby”问题
【发布时间】:2011-08-26 05:45:01
【问题描述】:

我正在尝试在 RHEL 6 上安装 Ruby on Rails 3。我已经 'yum install' sqlite 和 sqlite-devel(在 RHEL6 上是 sqlite3)。如您所见, sqlite3.h 确实存在于它需要的位置。由于某种原因,“gem install sqlite3-ruby”仍然无法正常工作。

SQLite3:

[root@rhel6base gems]# yum list sqlite-devel
Installed Packages
sqlite-devel.x86_64            3.6.20-1.el6            @local
Available Packages
sqlite-devel.i686              3.6.20-1.el6            local 

[root@rhel6base gems]# ls -l /usr/include/sqlite3.h
-rw-r--r--. 1 root root 268966 Nov 24  2009 /usr/include/sqlite3.h

宝石安装:

[root@rhel6base gems]# gem install sqlite3-ruby
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
    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

PS:创建一个'rhel6'标签肯定很好,但我没有足够的声誉。

【问题讨论】:

  • 你能把这些命令的输出:#cat /usr/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out 和#uname -a

标签: ruby sqlite gem rhel sqlite3-ruby


【解决方案1】:

我已经 'yum install' sqlite 和 sqlite-devel (这是 sqlite3 上 RHEL6)

这不是真的。从我的 RHEL6 服务器安装:

# yum search sqlite
...
sqlite.i686 : Library that implements an embeddable SQL database engine
sqlite-devel.i686 : Development tools for the sqlite3 embeddable SQL database engine
...

您缺少 sqlite3.h 文件。如果您需要一个应该在 RHEL6 存储库中的文件,请始终使用以下命令来查找它:

# yum provides /usr/include/sqlite3.h
sqlite-devel-3.6.20-1.el6.i686 : Development tools for the sqlite3 embeddable SQL database engine
Repo        : rhel-i386-server-6.0.z
Matched from:
Filename    : /usr/include/sqlite3.h

因此安装 sqlite-devel 包就可以编译成功了。祝你好运。

【讨论】:

  • 确实如此。 '/usr/include/sqlite3.h' 文件在那里。 'sqlite' 和 'sqlite-devel' 都是已安装的软件包。我将 sqlite3.h 头文件的存在显示为问题的第一行。
  • 'sqlite' 是用于 RHEL6 的 sqlite 的 'sqlite3' 版本 - 没有 pre-3 版本,就像 Ubuntu 和其他平台一样(我至少可以找到)。
  • 那么 sqlite-devel 在 RHEL6 上不是 sqlite3。这根本不是真的。这是两个单独的包,其中包含不同的文件。我不认为您确实安装了这两个软件包。
  • 顺便说一句,我怀疑架构。在上面的示例中,我可以看到您有 i686 yum repo,但安装的版本是 x86_64。您不得混合使用不同的架构。它不会编译。确保你有正确的拱门(uname -a 然后安装正确的包)。
  • 问题是没有安装 gcc。我没有看到非 sqlite3 sqlite 包装的任何内容。 'sqlite-devel' 和 'sqlite' 都安装了各自文件的 '3.6.20' 版本,即 IS sqlite3。 'yum info sqlite' 和 'yum info sqlite3' 会显示。
【解决方案2】:

事实证明,您必须安装 gcc 才能使“gem install sqlite3-ruby”工作。它永远不会明确告诉您找不到 gcc(甚至日志文件也没有提及)。

【讨论】:

  • 我推荐做 yum groupinstall "Development Tools" 来安装其他有价值的包。
猜你喜欢
  • 2015-07-01
  • 1970-01-01
  • 2019-07-11
  • 2014-11-17
  • 2014-08-11
  • 2017-01-16
  • 2012-10-13
  • 1970-01-01
  • 2011-04-17
相关资源
最近更新 更多