lundi 19 juin 2017

Ruby on rails, PG::InvalidParameterValue: ERROR:

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:inblock 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:ininstrument' /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:inexecute' /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:increate' /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:inblock 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:ineach' /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:increate_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:inblock 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:inexecute' /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:inmon_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:ininvoke' /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:inblock (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:inblock 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:intop_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:instandard_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:inblock 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:ininstrument' /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:inexecute' /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:increate' /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:inblock 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:ineach' /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:increate_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:inblock 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:inexecute' /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:inmon_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:ininvoke' /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:inblock (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:inblock 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:intop_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:instandard_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:inconnect' /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:innew' /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:innew_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:inacquire_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:incheckout' /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:inconnection' /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:inretrieve_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:ininitialize' /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:inup' /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:inmigrate' /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:innew' /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:ininitialize' /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:inpostgresql_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:incheckout_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:inblock 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:inblock 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:inretrieve_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:inconnection' /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:innew' /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:inmigrate' /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:inblock (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:ineval' /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