-1

I've finished creating my blog in Rails through following this tutorial: http://tutorials.jumpstartlab.com/projects/blogger.html

When I deployed my app to Heroku, I keep getting errors that prevented me from deploying. I've fixed my Gemfile, but I'm still getting the same error.

Here is what the terminal gave me:

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. ! ! Push rejected, failed to compile Ruby app

Here is what i fixed in my Gemfile:

group :development, :test do
gem 'sqlite3'end
cs-nerd
  • 73
  • 7

1 Answers1

0

Heroku recommends to use Postgresql instead of sqlite: https://devcenter.heroku.com/articles/sqlite3

so replace gem 'sqlite3' with gem 'pg'.

Furthermore, make sure that you use the gem in production. Your example only uses the sqlite gem in :development and in :test.

The result would be:

    group :development, :test, :production do
        gem 'pg'
    end

you could also only use postgres in production:

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

    group :production do
        gem 'pq'
    end

However, it is probably best to use the same database in development and production, to avoid any surprises later on.

Jelle
  • 339
  • 1
  • 12
  • I did replace it with pg, and ran "bundle install". It gave me another error: "An error occurred while installing pg (0.17.1), and Bundler cannot continue. Make sure that `gem install pg -v '0.17.1'` succeeds before bundling." Once I ran 'gem install pg -v '0.17.1', it gave me this error: "ERROR: Failed to build gem native extension". – cs-nerd Jul 17 '14 at 13:54
  • Are you refering to your local development environment or your development environment? Also, have you tried running `bundle update` before running `bundle install`? – Jelle Jul 17 '14 at 14:16
  • if postgres keeps failing to install locally, you might try this: http://stackoverflow.com/questions/24597159/cannot-install-pg-gem-on-mac-osx – Jelle Jul 17 '14 at 14:19
  • Great! Could you accept my answer of it helped you? – Jelle Jul 21 '14 at 21:07