0
votes

I'm trying to deploy my rails app to Heroku so I can have a staging server but keep running into the following error below.

I've removed the 'sqlite3' gem from my gemfile and made sure that the 'pg' gem is currently installed and also changed my database.yml to the following...but still getting the sqlite3 error. Any suggestions?

development:
adapter: postgresql
encoding: unicode
database: app-name
pool: 5
port: 5432
host: localhost

test:
adapter: postgresql
encoding: unicode
database: app-name
pool: 5
port: 5432
host: localhost

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

   /tmp/build_a4c50f3d-ca0b-4757-b846-70093165281e/vendor/ruby-2.0.0/bin/ruby extconf.rb
   checking for sqlite3.h... no
   sqlite3.h is missing. Try 'port install sqlite3 +universal',
   'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
   and check your shared library search path (the
   location where your sqlite3 shared library is located).
   *** 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=/tmp/build_a4c50f3d-ca0b-4757-b846-70093165281e/vendor/ruby-2.0.0/bin/ruby
   --with-sqlite3-dir
   --without-sqlite3-dir
   --with-sqlite3-include
   --without-sqlite3-include=${sqlite3-dir}/include
   --with-sqlite3-lib
   --without-sqlite3-lib=${sqlite3-dir}/
   --enable-local
   --disable-local


   Gem files will remain installed in /tmp/build_a4c50f3d-ca0b-4757-b846-70093165281e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9 for inspection.
   Results logged to /tmp/build_a4c50f3d-ca0b-4757-b846-70093165281e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9/ext/sqlite3/gem_make.out
   Installing transitions (0.1.11)
   Installing pg (0.17.0)
   Installing ffi (1.9.3)
   An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
   Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling.

! ! Failed to install gems via Bundler. ! ! Detected sqlite3 gem which is not supported on Heroku. ! https://devcenter.heroku.com/articles/sqlite3 !

! Push rejected, failed to compile Ruby app

1
Post your gem file here. - SSR
Remove Gemlock file and then again bundle the gems. - SSR
I actually got it. I didn't make a commit after changing the gemfile which prevented it from noticing the changes. Thanks for responding - user3444350

1 Answers

0
votes

I was also getting the same error message.I solved it by editing the Activerecord/Activesupport gems in my Sublime Text 2 Editor.I replaced sqlite3 with postgresql.However one must ensure the appropriate version of postgresql has been downloaded and installed.The error message is the developer's best friend.Learn to read and understand the error messages.Quite frustrating at first,but in reality,your best friend and good teacher.Thank you all.