2011-03-10 123 views
3

我運行的是由亞馬遜定製的Linux ami-595a0a1c構建的實例。我試圖安裝sqlite3的(或源碼)寶石和它與下面的錯誤而失敗:無法在Amazon Linux上安裝sqlite3 gem(已安裝ruby和sqlite的開發庫)

$ 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軟件包,仍然沒有骰子。由於這是亞馬遜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。提前致謝!

回答

0
$ sudo yum install libsqlite3-dev 

請注意版本。

或者如果包是在OS安裝提供libsqlite3-ruby

2

跑進這一點。令人驚訝的是,股票亞馬遜linux沒有安裝make或gcc。

sudo yum install gcc 
sudo yum install make 
+2

你還需要yum install ruby​​-devel yum install sqlite-devel – Jean 2012-01-12 19:40:11

相關問題