0

I'm following this tutorial on creating Ruby on Rail apps, and I've hit a roadblock. I am trying to migrate its database to Heroku, only to be told this:

c:\Sites\railsbridge\test_app>heroku run rails db:migrate
Running rails db:migrate on floating-ocean-40882... up, run.5709 (Free)
rails aborted!
Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not 
loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the 
minimum required by ActiveRecord).

I already have sqlite3 listed in my Gemfile, what am I doing wrong?

Robin Daugherty
  • 7,115
  • 4
  • 45
  • 59
CiaranC94
  • 176
  • 4
  • 20
  • 2
    If you want to use Heroku, then you need to use the `pg` gem to work with Postgresql instead Sqlite. – Sebastián Palma Jun 06 '17 at 00:20
  • This answer would have been found on Stackoverflow _and_ on [Heroku's documentation site](https://devcenter.heroku.com/articles/sqlite3) if you had searched for it first. Next time, copy the error message and search for it. – Robin Daugherty Jun 06 '17 at 13:50

2 Answers2

3

Heroku does not support sqlite and it is suggested to use postgresql for production

Please look into the following posts

Heroku deployment failed because of sqlite3 gem error

Deploying RoR app to Heroku with Sqlite3 fails

You can use Postgresql for production and the change should be simple. Just a change of gem in Gemfile and change in database.yml will do.

logesh
  • 2,572
  • 4
  • 33
  • 60
0

Heroku doesn't support SQLite it only support PostgresSQL here is full documentation for deployment on Heroku