2011-05-16 74 views
2

我試圖在RHEL 6上安裝Ruby on Rails 3.我已經'yum安裝'sqlite和sqlite-devel(它是RHEL6上的sqlite3)。正如你所看到的,sqlite3.h確實存在它需要的地方。 'gem install sqlite3-ruby'仍然不起作用,出於某種原因。問題在RHEL6上'gem install sqlite3-ruby'

的SQLite3:

[[email protected] 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 

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

寶石安裝:

[[email protected] 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

你可以把這些命令的輸出:#cat /usr/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out和#uname -a – lzap 2011-05-19 12:26:59

回答

4

事實證明,你必須爲'gem install sqlite3-ruby'安裝gcc才能正常工作。它永遠不會明確告訴你沒有找到gcc(即使日誌文件沒有提到它)。

+1

我建議做yum groupinstall「開發工具」來安裝其他有價值的軟件包。 – lzap 2011-05-26 09:00:17

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的包,你將能夠successfuly編譯。祝你好運。

+0

這是真的。 '/usr/include/sqlite3.h'文件就在那裏。 'sqlite'和'sqlite-devel'都是安裝包。我將sqlite3.h頭文件的存在顯示爲問題的第一行。 – Adam 2011-05-16 13:14:40

+0

'sqlite'是用於RHEL6的sqlite'sqlite3'版本 - 沒有3版本的前期版本,就像Ubuntu和其他平臺(至少我可以找到)一樣。 – Adam 2011-05-16 13:15:32

+0

在RHEL6上,sqlite-devel不是sqlite3。這根本不是事實。這是兩個獨立的包,其中包含不同的文件。我不認爲你安裝了兩個軟件包。 – lzap 2011-05-19 12:24:14