我正在尝试在RHEL 6上安装Ruby on Rails 3.我已经安装了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'标签肯定会很好,但我没有足够的声誉。
答案 0 :(得分:4)
事实证明你必须为'gem install sqlite3-ruby'安装gcc才能工作。它永远不会明确地告诉你找不到gcc(即使日志文件也没有提到它)。
答案 1 :(得分:1)
我已经安装了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 包,您将能够成功编译。祝你好运。