Forum: Ruby on Rails Trouble deploying to Heroku

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6de1f19624f27e2e059e2b511ef4bfe6?d=identicon&s=25 Travis Fantina (tfantina)
on 2016-08-01 21:12
I've posted this on StackOverflow and so far no one who has responded
has been able to help me.  Every time I try to push my project to Heroku
master I get this error:

remote:        Installing sqlite3 1.3.11 with native extensions
remote:
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native
extension.
remote:
remote:
/tmp/build_8e976ce77600e44a11e36d09919d7c00/vendor/ruby-2.2.4/bin/ruby
-r ./siteconf20160801-197-ag6qgz.rb extconf.rb
remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'port install sqlite3
+universal',
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:        --curdir
remote:
--ruby=/tmp/build_8e976ce77600e44a11e36d09919d7c00/vendor/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
remote:        --with-sqlite3-dir
remote:        --without-sqlite3-dir
remote:        --with-sqlite3-include
remote:        --without-sqlite3-include=${sqlite3-dir}/include
remote:        --with-sqlite3-lib
remote:        --without-sqlite3-lib=${sqlite3-dir}/lib
remote:
remote:        extconf failed, exit code 1
remote:
remote:        Gem files will remain installed in
/tmp/build_8e976ce77600e44a11e36d09919d7c00/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.11
for inspection.
remote:        Results logged to
/tmp/build_8e976ce77600e44a11e36d09919d7c00/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.11/gem_make.out
remote:        An error occurred while installing sqlite3 (1.3.11), and
Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.11'` succeeds
before bundling.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Detected sqlite3 gem which is not supported on Heroku.
remote:  !     https://devcenter.heroku.com/articles/sqlite3
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !  Push rejected to professor-ratings.
remote:

Which seems to be an SQLite problem, however this gem is not in my
production environment:

group :development, :test do
  gem 'sqlite3', '1.3.11'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %>
in views
  gem 'web-console', '~> 2.0'
  # Spring speeds up development by keeping your application running in
the background. Read more: https://github.com/rails/spring
  gem 'spring'

end
group :production do
  gem 'rails_12factor'
  gem 'puma', '~> 3.4'
  gem 'pg'
end

I've also updated database.yml purging unwanted SQLite stuff:

#
default: &default
  adapter: postgresql
  pool: 5
  timeout: 5000

development:
  adapter: sqlite3
  database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/test.sqlite3

production:
  <<: *default
  database: postgresdb

Any suggestions?
B896fce62a47fc4bce2dbd9ed7a26eb2?d=identicon&s=25 Ben Toogood (ben-toogood)
on 2016-08-30 17:42
Hey Travis,

In your gemfile, move the sqlite gem to the :development group and this
will be fixed :)

group :development do
  gem 'sqlite3'
end

All the best

Ben
This topic is locked and can not be replied to.