estoy importando un proyecto de carriles existente que yo estaba trabajando en mi nuevo sistema en Arch Linux, que ya ha instalado todas las gemas y PostgreSQL correctamente, pero tiene algunos problemas cuando runing:rake db: crear error de codificación con PostgreSQL
rake db:create
me sale el siguiente error
PGError: 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 "System_test" ENCODING = 'unicode'
creé manualmente la base de datos con la codificación correcta y las migraciones funcionó bien, pero puedo ejecutar el
rake db:test:clone
comando porque intenta crear una base de datos y no creo que cree manualmente las bases de datos tampoco. Entonces, alguien sabe arreglar esto?
saludos
EDIT: Aquí está mi database.yml
development:
adapter: postgresql
encoding: unicode
database: System_development
pool: 5
username: forellana
password:
test: &test
adapter: postgresql
encoding: unicode
database: System_test
pool: 5
username: forellana
password:
cucumber:
<<: *test
y aquí está la salida completa del comando
(in /home/fespinoza/Workspace/TLI)
PGError: 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 "System_test" ENCODING = 'unicode'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `rescue in log'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:199:in `log'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:493:in `execute'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:572:in `create_database'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:92:in `rescue in create_database'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:39:in `create_database'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:33:in `block (2 levels) in <top (required)>'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/home/fespinoza/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"System_test", "pool"=>5, "username"=>"forellana", "password"=>nil}
PGError: 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 "System_development" ENCODING = 'unicode'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `rescue in log'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:199:in `log'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:493:in `execute'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:572:in `create_database'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:92:in `rescue in create_database'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:39:in `create_database'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:35:in `block (2 levels) in <top (required)>'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/home/fespinoza/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/home/fespinoza/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"System_development", "pool"=>5, "username"=>"forellana", "password"=>nil}
¿Cuál es su archivo database.yml parece? –
¿Cómo instaló Postgresql en su sistema? ¿Fue de la fuente o de un paquete? ¿A qué se parece la salida de 'psql --command =" \ l "'? –