I’ve followed the Rails Tutorial up to the linked point.
Here’s the shell output:
jrhorn424 at hook in ~/Learning/rails/rails-tutorial/demo_app on master
$ heroku run rake db:migrate
Running rake db:migrate attached to terminal... up, run.2
### Snip ###
Migrating to CreateUsers (20120310145100)
Migrating to CreateMicroposts (20120311052021)
rake aborted!
database configuration does not specify adapter
Tasks: TOP => db:schema:dump
(See full trace by running task with --trace)
I’ve consulted the Heroku quick start, and done a bit of Googling. I suspected the problem was with config/database.yml since that is full of references to sqlite3 in my development environment. However, on the server, the same file includes these lines, among others:
adapter = uri.scheme
adapter = "postgresql" if adapter == "postgres"
Adding data through the deployed application succeeds, but running heroku run rake db:migrate still fails.
Here’s my Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.0'
group :production do
gem 'pg', '0.12.2'
end
I would recommend dropping your databases with:
If you are going to be hosting on heroku, go ahead and use postgres for all of your environments. Delete the sqlite gem and just include
near the top of your Gemfile.
Peform a:
Try to commit and push again (you know how to do that already).
Let me know if that doesn’t work.
PS, here is what my database.yml file looks like: