Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to get my ruby on rails up and running but i can't seem to install sqlite3-ruby gem . When i run it i get this error :

Fetching: sqlite-ruby-2.2.3.gem (100%) Building native extensions. This could take a while... ERROR: Error installing sqlite-ruby: ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb checking for main() in -lsqlite... no checking for sqlite.h... no * 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.

any solutions ?

share|improve this question
up vote 1 down vote accepted

Okay, so I think I have to post something since I'm telling folks they are incorrect.

In the case of sqlite-ruby libsqlite3-dev should do it.

To be clear the ruby-full pseudo package only installs all of the "components" for an almost all option ruby installation. It does absolutely nothing for dependency satisfaction for gems containing binary components.

To find out what dev packages a gem requires you can occasionally check the gem's specfile or the page on rubyforge. If it complains about a specific file not being found a little creative googling (the word provides often helps) should help you locate the -dev package that is required.

Another useful site for this type of thing is ubuntu package search:

Another point worth noting is that Ubuntu is siding with Debian on this one and trying to prebuild packages titled ruby-gemname or similar into aptitude to simplify package management and track gem changes. This does break some of the requires in some ruby scripts. I have quite the rant on that topic, but I digress.

If you install libsqlite3-dev and it still doesn't work - ensure you are using the correct architecture gem (this is not necessarily automatic, maybe a future feature would be great gem developers).

If you have that library installed and you are sure the architecture on the gem is correct, post what file it hangs on, and I'll see what I can dig up.

share|improve this answer
Yeah I think you got it down. Thats what he needs. – DJTripleThreat Jan 20 '11 at 0:32

Make sure you have sqlite3 v3.6.16 or greater installed. Gem needs 3.6.16 or greater to compile sqlite3-ruby.

You can check the version of your sqlite3 by first running which sqlite3 and then /path/to/sqlite3 -version.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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