1

So I deployed my app to Heroku and installed gem 'pg' and removed sqlite. Now getting this error when I migrate locally or on Heroku

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).

How can I fix this? Thanks

1 Answer 1

1

Add "sqlite3" in development and "pg" in production

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

group :production do
  gem 'pg'
end
Sign up to request clarification or add additional context in comments.

4 Comments

Now I got this error SQLite3::SQLException: duplicate column name: parent_id: ALTER TABLE "comments" ADD "parent_id" integer, I tried drop:all then create then migrate but sme error
try heroku run rake db:setup
Just :reset my database and the migration is working fine but still getting the error but now only in the view. Which is.. ActionView::Template::Error (undefined method `bio' for #<User:0x007fe52478d2d0>):
I think I have already posted answer for this error stackoverflow.com/a/39500764/4758119

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.