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
Tried ALL of other solutions, none helped.
It turned out that you also need dev package for ruby itself. For me, it helped
It has a lot of nasty dependencies though (like emacs, wtf?), just
should be fine. After it's installed (and you have the sqlite and sqlite-dev packages installed)
works like a charm.
From sqlite3-ruby gem can't find sqlite3.h on ubuntu:
You also need to install gcc itself, so in total it would be:
Apparently you get a wrong error pointing to a missing sqlite3.h when the actual problem is missing gcc itself.
This was simply enough to make it work
Thanks to marshluca
None of the above mentioned solution worked for me, even after installing
ruby2.5-dev
andlibsqlite3-dev
. Then tried usingPostgreSql
instead ofsqlite
. That worked fine. To usePostgreSql
instead of sqlite use this command when creatingrails
project.If you want to use
MySql
then usemysql
instead ofpostgresql
.Else you can try without
sqlite
.The solution is to add
--
to separateconfigure
parameters fromgem
parameters.instead of
try this, all on one line, make sure to include
--
after the lastgem
parameter and beforeconfigure
parameters:This should get you around this error:
I agree with Danya Vershinin & EnotionZ.
If can't use apt-get: