Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Heroku continues to detect sqlite3 for database adapter after grouping gem in to dev and test

When attempting to push my app to Heroku, it fails. It seems as though Heroku continues to detect sqlite3 as the database adapter even though I grouped it in the gem file for development and testing.

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

Here's my failed push

-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile. 

And Two observations I took notice of. SQLite3 is still listed in the gemfile lock and database.yml lists sqlite3 for production.

production:
  adapter:
  database: db/production.sqlite3
  pool: 5
  timeout: 5000 

4 Answers

Solved! Added gem 'rails_12factor' and ruby version to Gemfile, ran bundle update

Tedd Arcuri
Tedd Arcuri
8,058 Points

Nice! I was gonna say, I had the same issue but realized I was just being silly and forgot to run the bundle command to update the Gemfile.lock.

Everyone, always bundle! haha

Tedd Arcuri
Tedd Arcuri
8,058 Points

Nice! I was gonna say, I had the same issue but realized I was just being silly and forgot to run the bundle command to update the Gemfile.lock.

Everyone, always bundle! haha

Also, remember to commit your changes before trying to push to Heroku, because you are pushing the master branch, not the local code.