Installing sqlite headers on ubuntu (sqlite3.h not found)

Posted Posted by Wes in Ruby, Ruby on Rails     Comments 7 comments
Mar
5

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

7 Comments to “Installing sqlite headers on ubuntu (sqlite3.h not found)”

  • Freakin’ life saver! Thanks a bunch!

  • Just getting started w/ Rails and your hint got me going again. Thanks!!

  • Thanks alot for sharing, saved me some time :)

  • Thanks guy. Just what i need .

  • 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.

  • 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).

  • Ran into this issue installing diaspora. Thanks!

Post comment

about databasically

We live and work in Kansas City, USA.

We're passionate about helping small businesses succeed and want to help you use technology to get more done.

From server, desktop, network management to programming custom web applications in Ruby on Rails, we're here to lend a hand.

Contact us if you have any questions!