-2

I am trying to push my Rails 4 app to Heroku, but I keep getting the same error:

An error occurred while installing sqlite3 (1.3.10), and Bundler cannot
    continue.
 Make sure that `gem install sqlite3 -v '1.3.10'` succeeds before bundling.

  Failed to install gems via Bundler.
 Detected sqlite3 gem which is not supported on Heroku.

No where In my app do I make use of the sqlite gem.

Gemfile:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
gem 'puma'
# Use sqlite3 as the database for Active Record

# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'dotenv'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

group :production do
  gem 'pg'
  gem 'rails_12factor'
end
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'react-rails', '~> 1.0'
group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  # gem 'byebug'
  gem 'pry'
  # 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'
  gem 'pg'
  gem "factory_girl_rails", "~> 4.0"
  gem 'rspec-rails'
  gem 'faker'
  gem 'shoulda-matchers'
  gem 'guard-rspec'
  gem 'database_cleaner'
end

Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.2.0)
      actionpack (= 4.2.0)
      actionview (= 4.2.0)
      activejob (= 4.2.0)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.0)
      actionview (= 4.2.0)
      activesupport (= 4.2.0)
      rack (~> 1.6.0)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.1)
    actionview (4.2.0)
      activesupport (= 4.2.0)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.1)
    activejob (4.2.0)
      activesupport (= 4.2.0)
      globalid (>= 0.3.0)
    activemodel (4.2.0)
      activesupport (= 4.2.0)
      builder (~> 3.1)
    activerecord (4.2.0)
      activemodel (= 4.2.0)
      activesupport (= 4.2.0)
      arel (~> 6.0)
    activesupport (4.2.0)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    arel (6.0.0)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    builder (3.2.2)
    celluloid (0.16.0)
      timers (~> 4.0.0)
    coderay (1.1.0)
    coffee-rails (4.1.0)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.9.1.1)
    connection_pool (2.2.0)
    database_cleaner (1.4.1)
    debug_inspector (0.0.2)
    diff-lcs (1.2.5)
    dotenv (2.0.1)
    erubis (2.7.0)
    execjs (2.5.2)
    factory_girl (4.5.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.5.0)
      factory_girl (~> 4.5.0)
      railties (>= 3.0.0)
    faker (1.4.3)
      i18n (~> 0.5)
    ffi (1.9.8)
    formatador (0.2.5)
    globalid (0.3.5)
      activesupport (>= 4.1.0)
    guard (2.12.5)
      formatador (>= 0.2.4)
      listen (~> 2.7)
      lumberjack (~> 1.0)
      nenv (~> 0.1)
      notiffany (~> 0.0)
      pry (>= 0.9.12)
      shellany (~> 0.0)
      thor (>= 0.18.1)
    guard-compat (1.2.1)
    guard-rspec (4.5.1)
      guard (~> 2.1)
      guard-compat (~> 1.1)
      rspec (>= 2.99.0, < 4.0)
    hitimes (1.2.2)
    i18n (0.7.0)
    jbuilder (2.2.16)
      activesupport (>= 3.0.0, < 5)
      multi_json (~> 1.2)
    jquery-rails (4.0.3)
      rails-dom-testing (~> 1.0)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (1.8.2)
    listen (2.10.0)
      celluloid (~> 0.16.0)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
    loofah (2.0.2)
      nokogiri (>= 1.5.9)
    lumberjack (1.0.9)
    mail (2.6.3)
      mime-types (>= 1.16, < 3)
    method_source (0.8.2)
    mime-types (2.6.1)
    mini_portile (0.6.2)
    minitest (5.7.0)
    multi_json (1.11.0)
    nenv (0.2.0)
    nokogiri (1.6.6.2)
      mini_portile (~> 0.6.0)
    notiffany (0.0.6)
      nenv (~> 0.1)
      shellany (~> 0.0)
    pg (0.18.2)
    pry (0.10.1)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    puma (2.11.3)
      rack (>= 1.1, < 2.0)
    rack (1.6.1)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.0)
      actionmailer (= 4.2.0)
      actionpack (= 4.2.0)
      actionview (= 4.2.0)
      activejob (= 4.2.0)
      activemodel (= 4.2.0)
      activerecord (= 4.2.0)
      activesupport (= 4.2.0)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.0)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.6)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6.0)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.2)
      loofah (~> 2.0)
    rails_12factor (0.0.3)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.4)
    rails_stdout_logging (0.0.3)
    railties (4.2.0)
      actionpack (= 4.2.0)
      activesupport (= 4.2.0)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.4.2)
    rb-fsevent (0.9.5)
    rb-inotify (0.9.5)
      ffi (>= 0.5.0)
    rdoc (4.2.0)
      json (~> 1.4)
    react-rails (1.0.0)
      coffee-script-source (~> 1.8)
      connection_pool
      execjs
      rails (>= 3.1)
      react-source (~> 0.13)
    react-source (0.13.3)
    rspec (3.2.0)
      rspec-core (~> 3.2.0)
      rspec-expectations (~> 3.2.0)
      rspec-mocks (~> 3.2.0)
    rspec-core (3.2.3)
      rspec-support (~> 3.2.0)
    rspec-expectations (3.2.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.2.0)
    rspec-mocks (3.2.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.2.0)
    rspec-rails (3.2.1)
      actionpack (>= 3.0, < 4.3)
      activesupport (>= 3.0, < 4.3)
      railties (>= 3.0, < 4.3)
      rspec-core (~> 3.2.0)
      rspec-expectations (~> 3.2.0)
      rspec-mocks (~> 3.2.0)
      rspec-support (~> 3.2.0)
    rspec-support (3.2.2)
    sass (3.4.14)
    sass-rails (5.0.3)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (~> 1.1)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    shellany (0.0.1)
    shoulda-matchers (2.8.0)
      activesupport (>= 3.0.0)
    slop (3.6.0)
    spring (1.3.6)
    sprockets (3.1.0)
      rack (~> 1.0)
    sprockets-rails (2.3.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (>= 2.8, < 4.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (1.4.1)
    timers (4.0.1)
      hitimes
    turbolinks (2.5.3)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.7.1)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    web-console (2.1.2)
      activemodel (>= 4.0)
      binding_of_caller (>= 0.7.2)
      railties (>= 4.0)
      sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
  ruby

DEPENDENCIES
  coffee-rails (~> 4.1.0)
  database_cleaner
  dotenv
  factory_girl_rails (~> 4.0)
  faker
  guard-rspec
  jbuilder (~> 2.0)
  jquery-rails
  pg
  pry
  puma
  rails (= 4.2.0)
  rails_12factor
  react-rails (~> 1.0)
  rspec-rails
  sass-rails (~> 5.0)
  sdoc (~> 0.4.0)
  shoulda-matchers
  spring
  turbolinks
  uglifier (>= 1.3.0)
  web-console (~> 2.0)

I can't seem to figure out what is going on and would appreciate any help.

Thanks

bobcobb
  • 149
  • 1
  • 5
  • 10

3 Answers3

0

Even though you are using pg both in production and development I think putting sqlite3 in your development group in the Gemfile should prevent Heroku from throwing you errors.

group :development, :test do
  gem 'pry'
  gem 'sqlite3'
  ...
end

Now remove Gemfile.lock file then run bundle install --without production You can then commit and push to Heroku just fine.

Cyzanfar
  • 6,997
  • 9
  • 43
  • 81
0

I was trying to push to Herkou from a local branch of mine. Turns out by default it pushes the master branch (which made use of the sqlite gem).

I was able to successfully push my local branch by doing:

git push heroku (branchname):master

source: https://devcenter.heroku.com/articles/multiple-environments#advanced-linking-local-branches-to-remote-apps

bobcobb
  • 149
  • 1
  • 5
  • 10
0

I see you have a comment referencing sqlite3 in your Gemfile. My guess is you previously used it but switched to Postgres at some point.

It's hard to say exactly without your full project, but here are two suggestions...

Outdated Gemfile.lock on Heroku

Your Gemfile.lock file on Heroku may be different, and may be still referencing sqlite3. You can force a rebuild of this file by running bundle update on the server via...

$ heroku run bundle update --app <app_name>

Outdated config/database.yml

Did you also update your config/database.yml file? I'm not sure what would happen, but perhaps if the "adapter" line is referencing sqlite3, that is triggering it to try and use that gem.

Tim Holt
  • 3,044
  • 1
  • 18
  • 22