Every time I try to run bundle exec rake db:create db:migrate I get this error, anyone know how to fix it?
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template. : CREATE DATABASE "ruby-getting-started_development" ENCODING = 'unicode' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in async_exec' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in
block in execute' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:484:in block in log' /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in
instrument' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:478:in log' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in
execute' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/schema_statements.rb:78:in create_database' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/postgresql_database_tasks.rb:15:in
create' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:93:in create' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:107:in
block in create_current' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:276:in block in each_current_configuration' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:275:in
each' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:275:in each_current_configuration' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:106:in
create_current' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/railties/databases.rake:17:in block (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in
block in execute' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in each' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in
execute' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in
mon_synchronize' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in invoke_with_call_chain' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in
invoke' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in invoke_task' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in
block (2 levels) in top_level' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in each' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in
block in top_level' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in run_with_threads' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in
top_level' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in block in run' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in
standard_exception_handling' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in run' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/exe/rake:27:in
' /usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in load' /usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in
' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in
' Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"ruby-getting-started_development"} PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template. : CREATE DATABASE "ruby-getting-started_test" ENCODING = 'unicode' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in async_exec' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in
block in execute' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:484:in block in log' /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in
instrument' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:478:in log' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in
execute' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/schema_statements.rb:78:in create_database' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/postgresql_database_tasks.rb:15:in
create' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:93:in create' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:107:in
block in create_current' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:276:in block in each_current_configuration' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:275:in
each' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:275:in each_current_configuration' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:106:in
create_current' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/railties/databases.rake:17:in block (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in
block in execute' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in each' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in
execute' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in
mon_synchronize' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in invoke_with_call_chain' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in
invoke' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in invoke_task' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in
block (2 levels) in top_level' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in each' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in
block in top_level' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in run_with_threads' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in
top_level' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in block in run' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in
standard_exception_handling' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in run' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/exe/rake:27:in
' /usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in load' /usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in
' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in
' Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"ruby-getting-started_test"} rake aborted! ActiveRecord::NoDatabaseError: FATAL: database "ruby-getting-started_development" does not exist /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:661:in rescue in connect' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in
connect' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in initialize' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in
new' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in postgresql_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in
new_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in checkout_new_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in
acquire_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in block in checkout' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in
checkout' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in block in connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in
connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in retrieve_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:113:in
retrieve_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:87:in connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:916:in
initialize' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:823:in new' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:823:in
up' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:801:in migrate' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:137:in
migrate' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/railties/databases.rake:44:in block (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/exe/rake:27:in
' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in
' PG::ConnectionBad: FATAL: database "ruby-getting-started_development" does not exist /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in initialize' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in
new' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in connect' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in
initialize' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in new' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in
postgresql_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in new_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in
checkout_new_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in acquire_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in
block in checkout' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in checkout' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in
block in connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in
retrieve_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:113:in retrieve_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:87:in
connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:916:in initialize' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:823:in
new' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:823:in up' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:801:in
migrate' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:137:in migrate' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.8/lib/active_record/railties/databases.rake:44:in
block (2 levels) in ' /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/exe/rake:27:in <top (required)>' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in
eval' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `' Tasks: TOP => db:migrate (See full trace by running task with --trace)
Aucun commentaire:
Enregistrer un commentaire