Installing sqlite headers on ubuntu (sqlite3.h not found)
I was setting up Integrity for the first time and ran into this on my server when bundling gems:
~$ bundle install ... Installing do_sqlite3 (0.10.0) from rubygems repository at http://gemcutter.org/ with native extensions /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:482:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /usr/bin/ruby1.8 extconf.rb checking for sqlite3.h... no *** extconf.rb failed *** ...
The key is the line: checking for sqlite3.h... no
The do_sqlite3 gem gets compiled natively, but the development headers weren’t installed on the system and so the compilation won’t work.
Install them:
~$ sudo apt-get install sqlite3 ~$ sudo apt-get install libsqlite3-dev
Then, re-bundle:
~$ bundle install

Posted by Wes in
Corindiano says:
Freakin’ life saver! Thanks a bunch!
Matt says:
Just getting started w/ Rails and your hint got me going again. Thanks!!
skyw00lker says:
Thanks alot for sharing, saved me some time :)
ranska says:
Thanks guy. Just what i need .
Rick says:
This can also be a problem of missing gcc.
During the gem build, it does a check for the header by compiling little program containing one line:
#include
And if that fails, it seems to assume the header is missing. It doesn’t take into account that gcc could be missing, causing the error. So if the article doesn’t help, make sure you have gcc installed.
Rick says:
In my above comment, the #include line should say
#include “sqlite3.h”, where the double quotes are actually angle brackets (which must have borked the comment system).
Barbariandude says:
Ran into this issue installing diaspora. Thanks!