Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "sqlite3.h is missing"?

I am trying to do some project in ruby and make like this

git commit -am "Add hello" heroku create git push heroku master

then I got this error

remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'brew install sqlite3',
remote:        'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote:        and check your shared library search path (the
remote:        location where your sqlite3 shared library is located).
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:
remote:        Provided configuration options:
remote:         --with-opt-dir
remote:         --without-opt-dir
remote:         --with-opt-include
remote:         --without-opt-include=${opt-dir}/include
remote:         --with-opt-lib
remote:         --without-opt-lib=${opt-dir}/lib
remote:         --with-make-prog
remote:         --without-make-prog
remote:         --srcdir=.
remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'brew install sqlite3',
remote:        'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote:        and check your shared library search path (the
remote:        location where your sqlite3 shared library is located).
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:
remote:        Provided configuration options:
remote:         --with-opt-dir
remote:         --without-opt-dir
remote:         --with-opt-include
remote:         --without-opt-include=${opt-dir}/include
remote:         --with-opt-lib
remote:         --without-opt-lib=${opt-dir}/lib
remote:         --with-make-prog
remote:         --without-make-prog
remote:         --srcdir=.

I tried to change my gemfile like this tutorial https://devcenter.heroku.com/articles/sqlite3 and this tutorial Detected sqlite3 gem which is not supported on Heroku but nothing changed.

I tried to install sqlite3 by this

gem install sqlite3

and success, but nothing changed. It still give me error when I want to push heroku master.

Could you please give me any suggestion?

like image 349
Anh Bui Avatar asked Jul 10 '26 17:07

Anh Bui


1 Answers

I had the same issue when I tried to create a new rails project. I solved it by running this command(based on the instruction from the terminal output error message) on the Ubuntu: sudo apt-get install libsqlite3-dev Then after the installation, I recreate the project and it works. I assume that sqlite3 is installed on your computer. If it is not installed you can run this command sudo apt install sqlite3 then you can run the above command.

like image 86
Temitayo Adeleke Avatar answered Jul 13 '26 15:07

Temitayo Adeleke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!