Forum: Rails-ES Problema con rake:db:create:all Unknown database 'tiendaonline_development'

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0cd446ac0fa70a937c5ba9fd17b39d5d?d=identicon&s=25 xurde dix (Guest)
on 2009-01-20 10:47
(Received via mailing list)
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:in
`connect'
/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:in
`new'
/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:in
`send'
/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:in
`retrieve_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:in
`instance'
/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:in
`load'
/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:in
`new_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:in
`load_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:in
`load_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:in `send'
/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:in
`run'
/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:in `require'
/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:in
`new_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:in `call'
/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:in `each'
/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:in
`invoke_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:in
`invoke_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:in `each'
/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:in
`invoke_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:in
`invoke_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:in `invoke_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:in `each'
/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:in
`standard_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:in `run'
/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:in `run'
/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 Garcia
6f952bee7570a3db2ecba5b06c0062b3?d=identicon&s=25 Fernando Guillen (fguillen)
on 2009-01-20 10:59
(Received via mailing list)
2009/1/20 xurde dix <xurdedix@gmail.com>:
> 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.
F625b891618be8ec32547a07b3192bb0?d=identicon&s=25 Francesc Esplugas (fesplugas)
on 2009-01-20 11:11
(Received via mailing list)
On Tue, Jan 20, 2009 at 10:59 AM, Fernando Guillen
<fguillen.mail@gmail.com> wrote:

>> Unknown database 'tiendaonline_development'

No tienes la base de datos MySQL creada por eso te dice "Unknown
database".
0cd446ac0fa70a937c5ba9fd17b39d5d?d=identicon&s=25 xurde dix (Guest)
on 2009-01-20 11:20
(Received via mailing list)
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 Guillen <fguillen.mail@gmail.com>
6f952bee7570a3db2ecba5b06c0062b3?d=identicon&s=25 Fernando Guillen (fguillen)
on 2009-01-20 11:24
(Received via mailing list)
2009/1/20 Francesc Esplugas <francesc.esplugas@gmail.com>:
> On Tue, Jan 20, 2009 at 10:59 AM, Fernando Guillen
> <fguillen.mail@gmail.com> 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.. :/

f.
6f952bee7570a3db2ecba5b06c0062b3?d=identicon&s=25 Fernando Guillen (fguillen)
on 2009-01-20 11:25
(Received via mailing list)
2009/1/20 xurde dix <xurdedix@gmail.com>:
> 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.
0cd446ac0fa70a937c5ba9fd17b39d5d?d=identicon&s=25 xurde dix (Guest)
on 2009-01-20 11:26
(Received via mailing list)
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 Garcia

2009/1/20 Francesc Esplugas <francesc.esplugas@gmail.com>
6f952bee7570a3db2ecba5b06c0062b3?d=identicon&s=25 Fernando Guillen (fguillen)
on 2009-01-20 11:30
(Received via mailing list)
2009/1/20 xurde dix <xurdedix@gmail.com>:
> 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 :)

f.
0cd446ac0fa70a937c5ba9fd17b39d5d?d=identicon&s=25 xurde dix (Guest)
on 2009-01-20 12:40
(Received via mailing list)
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 Guillen <fguillen.mail@gmail.com>
39086eb3d9a1437276d07c08ea0c3821?d=identicon&s=25 Guillermo Álvarez Fernández (Guest)
on 2009-01-20 13:22
(Received via mailing list)
¿Probaste un simple rake db:create ?

Vamos sin el all.
0cd446ac0fa70a937c5ba9fd17b39d5d?d=identicon&s=25 xurde dix (Guest)
on 2009-01-20 13:27
(Received via mailing list)
si con el mismo resultado

2009/1/20 Guillermo Álvarez Fernández <guillermo@cientifico.net>
396ed672fb27ee6c61a735401d7c7c0b?d=identicon&s=25 Yoel (Guest)
on 2009-01-20 14:13
(Received via mailing list)
Francesc Esplugas 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.
0cd446ac0fa70a937c5ba9fd17b39d5d?d=identicon&s=25 xurde dix (Guest)
on 2009-01-22 12:21
(Received via mailing list)
Problema resuelto. el error solo ocurre en aplicaciones Spree.

Muchas gracias a todos por la ayuda.

Jorge Garcia

2009/1/20 Yoel <yvillarreal@isp.vcl.rimed.cu>
Adce10d7f1dbabcdab8f525a59cec32f?d=identicon&s=25 Andrés Gutiérrez (andresgutgon)
on 2009-01-22 12:28
(Received via mailing list)
¿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 <xurdedix@gmail.com>
6f952bee7570a3db2ecba5b06c0062b3?d=identicon&s=25 Fernando Guillen (fguillen)
on 2009-01-22 18:51
(Received via mailing list)
2009/1/22 xurde dix <xurdedix@gmail.com>:
> Problema resuelto. el error solo ocurre en aplicaciones Spree.

Y cómo se resolvía?
0cd446ac0fa70a937c5ba9fd17b39d5d?d=identicon&s=25 xurde dix (Guest)
on 2009-01-22 19:59
(Received via mailing list)
¿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 Guillen <fguillen.mail@gmail.com>

> 2009/1/22 xurde dix <xurdedix@gmail.com>:
> > 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.
This topic is locked and can not be replied to.