Problema con rake:db:create:all Unknown database 'tiendaonline_development'


#1

Hola Lista

A ver si me podeis ayudar con este problema:

Al ejecutar rake db:create:all me da este error:

(in /home/xurde/WEBS/tiendaOnline)
rake aborted!
Unknown database ‘tiendaonline_development’

Muestro el Error completo con :

rake db:create:all --trace

(in /home/xurde/WEBS/tiendaOnline)
** Invoke db:create:all (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Unknown database ‘tiendaonline_development’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:527:in
real_connect' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:527:inconnect’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:186:in
initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:85:innew’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:85:in
mysql_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:insend’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in
connection=' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:inretrieve_connection’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
connection' /usr/lib/ruby/gems/1.8/gems/spree-0.5.1/lib/spree/config.rb:15:ininstance’
/usr/lib/ruby/gems/1.8/gems/spree-0.5.1/lib/preference_access.rb:7:in
[]' /home/xurde/WEBS/tiendaOnline/config/initializers/spree.rb:39 /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:503:inload’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:503:in
load' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:innew_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:503:in
load' /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:484:inload_application_initializers’
/usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:483:in each' /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:483:inload_application_initializers’
/usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:149:in
process' /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:97:insend’
/usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:97:in run' /usr/lib/ruby/gems/1.8/gems/spree-0.5.1/lib/spree/initializer.rb:87:inrun’
/home/xurde/WEBS/tiendaOnline/config/environment.rb:13
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in
require' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:innew_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in
require' /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/tasks/misc.rake:3 /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:incall’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:ineach’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:ininvoke_with_call_chain’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in
invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:ineach’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in
invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:ininvoke_with_call_chain’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:ininvoke_task’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:ineach’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:instandard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:inrun’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:inrun’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:16:in `load’
/usr/bin/rake:16

Miro las versiones:

rails -v
Rails 2.1.2
gem -v
1.3.1
rake -v Produce el siguiente error:

(in /home/xurde/WEBS/tiendaOnline)
/usr/bin/ruby1.8 -Ilib:test
“/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb”
/usr/bin/ruby1.8 -Ilib:test
“/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb”
Errors running test:units!

pongo tambien una lista de la gemas que tengo instaladas:

gem list --local

*** LOCAL GEMS ***

actionmailer (2.2.2, 2.1.2, 2.1.0)
actionpack (2.2.2, 2.1.2, 2.1.0)
activemerchant (1.4.0)
activerecord (2.2.2, 2.1.2, 2.1.0)
activeresource (2.2.2, 2.1.2, 2.1.0)
activesupport (2.2.2, 2.1.2, 2.1.0)
builder (2.1.2)
cgi_multipart_eof_fix (2.5.0)
columnize (0.3.0)
daemons (1.0.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
has_many_polymorphs (2.12)
highline (1.5.0, 1.4.0)
hoe (1.8.2)
linecache (0.43)
mini_magick (1.2.3)
mongrel (1.1.5)
nokogiri (1.1.1)
rails (2.1.2, 2.1.0)
rake (0.8.3)
rmagick (2.8.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
rubyforge (1.0.2)
rubygems-update (1.3.1)
sources (0.0.1)
spree (0.5.1)
tlsmail (0.0.1)

Recientemente actualize rubygmes de la version 0.9.4 a la 1.3.1 . Me dio
un
problema que quedaron las 2 instaladas que solucione con:
mv /usr/bin/gem /usr/bin/gem.bak
ln -s /usr/bin/gem1.8 /usr/bin/gem

la unica web que encontre con informacion:
http://code.google.com/p/otwarchive/issues/detail?id=38

Jorge G.


#2

2009/1/20 xurde dix removed_email_address@domain.invalid:

Hola Lista

A ver si me podeis ayudar con este problema:

Al ejecutar rake db:create:all me da este error:

(in /home/xurde/WEBS/tiendaOnline)
rake aborted!
Unknown database ‘tiendaonline_development’

Puedes pastear el database.yml a ver si hay algo raro?

f.


#3

On Tue, Jan 20, 2009 at 10:59 AM, Fernando G.
removed_email_address@domain.invalid wrote:

Unknown database ‘tiendaonline_development’

No tienes la base de datos MySQL creada por eso te dice “Unknown
database”.


#4

development:
adapter: mysql
encoding: utf8
database: tiendaonline_development
username: root
password:
socket: /var/run/mysqld/mysqld.sock

test:
adapter: mysql
encoding: utf8
database: tiendaonline_test
username: root
password:
socket: /var/run/mysqld/mysqld.sock

production:
adapter: mysql
encoding: utf8
database: tiendaonline_production
username: root
password:
socket: /var/run/mysqld/mysqld.soc

2009/1/20 Fernando G. removed_email_address@domain.invalid


#5

2009/1/20 Francesc E. removed_email_address@domain.invalid:

On Tue, Jan 20, 2009 at 10:59 AM, Fernando G.
removed_email_address@domain.invalid wrote:

Unknown database ‘tiendaonline_development’

No tienes la base de datos MySQL creada por eso te dice “Unknown database”.

sip pero es un rake db:create:all Francesc… :confused:

f.


#6

2009/1/20 xurde dix removed_email_address@domain.invalid:

development:
adapter: mysql
encoding: utf8
database: tiendaonline_development
username: root
password:
socket: /var/run/mysqld/mysqld.sock

Tienes acceso a la DB con ese usuario y sin password?

$ mysql -uroot

:^?

f.


#7

No estoy haciendo una migracion con rake db:migrate

El error me lo da al crear la base de datos con

rake db:create:all

gracias por vuestra colaboración

Jorge G.

2009/1/20 Francesc E. removed_email_address@domain.invalid


#8

2009/1/20 xurde dix removed_email_address@domain.invalid:

No estoy haciendo una migracion con rake db:migrate

El error me lo da al crear la base de datos con

rake db:create:all

Sipi… pero necesitas permisos para poder crear la BD… que no digo
que se el problema, seguramente no lo sea… pero por eliminar
posibilidades:

$ mysql -uroot
mysql> create database tiendaonline_development;

por ver :slight_smile:

f.


#9

Asi si me crea la BBDD

mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 71
Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> create database tiendaonline_development;
Query OK, 1 row affected (0.00 sec)

El problema es que no me funciona el rake.
rake -v Produce el siguiente error:

(in /home/xurde/WEBS/tiendaOnline)
/usr/bin/ruby1.8 -Ilib:test
“/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb”

/usr/bin/ruby1.8 -Ilib:test
“/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb”
Errors running test:units!

2009/1/20 Fernando G. removed_email_address@domain.invalid


#10

¿Probaste un simple rake db:create ?

Vamos sin el all.


#11

si con el mismo resultado

2009/1/20 Guillermo Álvarez Fernández removed_email_address@domain.invalid


#12

Francesc E. wrote:

No tienes la base de datos MySQL creada por eso te dice “Unknown database”.

Francesc… mis respetos para usted como referencia obligada que es en
este espacio de RoR-es pero no se supone que rake:db:create:all lo que
haga sea crear todas las DB consignadas en el database.yml ???

A mi entender el bateo que tuvo el socio fue de mala conf de ese
archivito… o que no tenia permisos adecuados seteados alli.


Visite nuestra web en Internet
http://www.ispvc.rimed.cu
“50 Años de Educación en
Revolución”

XI Encuentro Internacional de Economistas sobre Globalización y Problemas
del Desarrollo 2 al 6 de marzo de 2009
http://www.anec.cu/


Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.


#13

Problema resuelto. el error solo ocurre en aplicaciones Spree.

Muchas gracias a todos por la ayuda.

Jorge G.

2009/1/20 Yoel removed_email_address@domain.invalid


#14

2009/1/22 xurde dix removed_email_address@domain.invalid:

Problema resuelto. el error solo ocurre en aplicaciones Spree.

Y cómo se resolvía?


#15

¿aplicaciones Spree? ¿Te refieres a esto [1]?

He googleado y es lo que más relación tenia con rails, que yo haya
visto.
[1] http://spreehq.org/

2009/1/22 xurde dix removed_email_address@domain.invalid


#16

¿aplicaciones Spree? ¿Te refieres a esto [1]?

He googleado y es lo que más relación tenia con rails, que yo haya
visto.
[1] http://spreehq.org/

Si me referia eso.

2009/1/22 Fernando G. removed_email_address@domain.invalid

2009/1/22 xurde dix removed_email_address@domain.invalid:

Problema resuelto. el error solo ocurre en aplicaciones Spree.

Y cómo se resolvía?

“rake db:create:all” genera error pero “rake db:bootstrap” genera las
BBDDs
y ejecuta las migraciones.