I'm running an instance built off ami-595a0a1c. I am trying to install the sqlite3 (or sqlite) gem and it's failing with the below error:

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

Typically, this just means you need to install the development libraries and everything is cool. However, I have installed the sqlite-devel packages and still no dice. Since this is the Amazon Linux instance, I'd rather not add more repositories than the ones Amazon provides if possible. What can i do to get this thing to compile? Thanks for any insight!

From a brand new instance, here's what I've done:

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

See breakage above


I just tested today on AWS' AMI. Same problem at first when trying to install the sqlite3 gem. Tried as told by the installer, no luck. However, I tried

sudo gem install sqlite-devel

and it worked, could install the sqlite3 gem after that...

Hoping it'll help.


I figured it out, I guess this answer on stackoverflow will also help you


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.