我正试图从sqlite转移到postgres所以我可以使用Heroku。 (虽然这是错误发生在本地)。
我的database.yml
目前看起来像这样:
default: &default
adapter: postgresql
pool: 5
timeout: 5000
development:
<<: *default
database: db_development
test:
<<: *default
database: db_test
production:
<<: *default
database: db_production
我已经运行rake db:create db:migrate
但是我收到了这个错误:
FATAL: database "db/development.sqlite3" does not exist Run `$ bin/rake db:create db:migrate` to create your database
db/development.sqlite3
中database.yml
已不再存在,这令人困惑。它被db_development
取代。我的gem文件中也没有提到sqlite3
。
修改
根据以下建议,$ grep -rn 'development.sqlite3' *
会返回:
log/development.log:3225:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3287:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3349:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3414:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3476:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3538:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3600:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3663:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3725:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3787:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3849:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3914:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:3976:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4038:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4100:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4162:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4224:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4287:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4349:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4411:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4477:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4539:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4605:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4667:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4729:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4791:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4853:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4915:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:4977:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5043:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5105:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5167:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5229:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5292:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5354:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5416:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5478:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5541:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5603:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5665:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5731:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5793:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5855:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5927:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:5989:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:6051:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:6113:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:6175:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:6237:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:6299:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
log/development.log:6361:ActiveRecord::NoDatabaseError (FATAL: database "db/development.sqlite3" does not exist
vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.7/lib/active_record/connection_handling.rb:101: # # => {pool: 5, timeout: 5000, database: "db/development.sqlite3", adapter: "sqlite3"}
vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.7/lib/active_record/core.rb:27: # database: db/development.sqlite3
vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.7/lib/active_record/core.rb:38: # 'database' => 'db/development.sqlite3'
vendor/bundle/ruby/2.0.0/gems/rails-4.1.7/guides/source/configuring.md:613: database: db/development.sqlite3
vendor/bundle/ruby/2.0.0/gems/rails-4.1.7/guides/source/configuring.md:666: database: db/development.sqlite3
vendor/bundle/ruby/2.0.0/gems/rails-4.1.7/guides/source/configuring.md:922: database: db/development.sqlite3
vendor/bundle/ruby/2.0.0/gems/railties-4.1.7/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml:12: database: db/development.sqlite3
vendor/bundle/ruby/2.0.0/gems/railties-4.1.7/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml:14: database: db/development.sqlite3
vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.7/lib/active_record/connection_handling.rb:101: # # => {pool: 5, timeout: 5000, database: "db/development.sqlite3", adapter: "sqlite3"}
vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.7/lib/active_record/core.rb:27: # database: db/development.sqlite3
vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.7/lib/active_record/core.rb:38: # 'database' => 'db/development.sqlite3'
vendor/bundle/ruby/2.2.0/gems/rails-4.1.7/guides/source/configuring.md:613: database: db/development.sqlite3
vendor/bundle/ruby/2.2.0/gems/rails-4.1.7/guides/source/configuring.md:666: database: db/development.sqlite3
vendor/bundle/ruby/2.2.0/gems/rails-4.1.7/guides/source/configuring.md:922: database: db/development.sqlite3
vendor/bundle/ruby/2.2.0/gems/railties-4.1.7/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml:12: database: db/development.sqlite3
vendor/bundle/ruby/2.2.0/gems/railties-4.1.7/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml:14: database: db/development.sqlite3