0

I am continuously getting a

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.

error when attempting to deploy to Heroku, I have tried all overflow questions thus far.

This is my gemfile

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.1'
# Use sqlite3 as the database for Active Record
gem 'pg'
# 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/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'therubyracer'
# 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

# 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

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
 gem 'byebug'
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

and this is my .yml

default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

test:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default
  database: db/production.sqlite3

I'm thinking is has something to do with my .yml but I really have no idea. I can run it locally but when I true to

git push heroic master

I get that error

anonrose
  • 1,271
  • 3
  • 12
  • 19

2 Answers2

0

well the solution here is: https://devcenter.heroku.com/articles/sqlite3

You need to use postgresql in production env. sqlite3 is not supported so either change adapter to postgresql or add your sqlite3 to develop and test group and add postgres to production group

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

group :production do
  gem 'pg'
end

and change your database.yml to:

# config/database.yml
default: &default
  pool: 5
  timeout: 5000

development:
  <<: *default
  adapter: sqlite3
  database: db/development.sqlite3

test:
  <<: *default
  adapter: sqlite3
  database: db/test.sqlite3

production:
  <<: *default
  adapter: postgresql
  host: localhost
  database: production
  username: postgres
  password: password
Deepak Mahakale
  • 22,834
  • 10
  • 68
  • 88
  • Ya, that was one of the first things I saw. It didn't seem to resolve my error, I've added those gems in that order to my gem file as well as changing my database.yml to your suggestion, adding to master and trying it again. Nothing. – anonrose Feb 22 '16 at 06:11
0

You cannot use SQLite3 on Heroku. Replace SQLIte3 with PostgreSQL, and update your Gemfile.

# replace gem "sqlite3" with
gem "pg"

You only need to update your development and test database configurations. As in production the database.yml file is updated automatically by Heroku. In fact, you don't even have to commit it to your repository.

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364