views:

848

answers:

7

I have the following error during sqlite3-ruby install:

Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
    ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel'
*** 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/ruby1.8
    --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/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out

sqlite3.h is located in /usr/include/

sudo gem install sqlite3-ruby --without-sqlite3-include=/usr/include

doesn't work


ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --without-sqlite3-include=/usr/include

Ubuntu 10.04

A: 

Not --without-sqlite3-include=/usr/include, but --with-sqlite3-include=/usr/include.

floatless
Doesn't work.. sqlite3.h is still missing
Stel
If sqlite3.h is really missing and not in /usr/include as you said, then you can install it with: sudo apt-get install libsqlite3-dev
Kurt
I have already done this.. It doesn't help. I have sqlite3 and libsqlite3-dev installed.
Stel
A: 

You just need a -- in there.

sudo gem install sqlite3-ruby -- --with-sqlite3-include=/usr/include

That specifies that the option is not to gem directly, but the specific gem.

Kurt
A: 

Doesn't work..

sqlite3.h is missing. 
...
Stel
This is not an answer...
moxn
At 19 reputation they can't comment on stuff yet.
calvinf
A: 

Aha-ha!

sudo apt-get install build-essential ;)
Stel
+7  A: 

I got the same problem and solved like below:

apt-get install libsqlite3-dev

marshluca
Did the trick for me as well!
enriquein
This worked for me too.
paracaudex
solves the issue in maverick too.
fly.floh
A: 

same issue - this is not answered.

sqlite3.h is non-existent and all the above packages are installed.

ubunut 10.10

rrt
A: 

If you run in ubuntu,and using RVM for ruby on rails,please add FIRST:

sudo apt-get install libxslt-dev libxml2-dev

OR You can check with these commands:

This command will prepare for you two packages : sqllite3 and libsqlite3-dev

sudo apt-get install sqlite3 libsqlite3-dev

-Now,install sqlite gem

 [sudo] gem install sqlite3-ruby

-using Ubuntu doesn't need sudo.

Goodluck! Note: i'm using Ubuntu 10.10 and it's working.

kidcoder