2012-04-26 24 views
9

Creo una aplicación de rieles simple y cuando ejecuto rieles s. Emite esta pila de errores: -s Intenté volver a instalar activerecord pero no pudo resolver el problema. Además, traté de usar rvm para eliminar todo el gemset y volver a instalar, pero sigue siendo el mismo.Método no definido fetch for false: FalseClass

/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:33:in `resolve_string_connection': undefined method `fetch' for false:FalseClass (NoMethodError) 
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:23:in `spec' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:127:in `establish_connection' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/railtie.rb:76:in `block (2 levels) in <class:Railtie>' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:25:in `each' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:25:in `on_load' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/railtie.rb:74:in `block in <class:Railtie>' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing' 
from /home/vic4ever/crowdvn/crowd.vn/config/environment.rb:5:in `<top (required)>' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency' 
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' 
from /home/vic4ever/crowdvn/crowd.vn/config.ru:4:in `block in <main>' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize' 
from /home/vic4ever/crowdvn/crowd.vn/config.ru:1:in `new' 
from /home/vic4ever/crowdvn/crowd.vn/config.ru:1:in `<main>' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands/server.rb:46:in `app' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 
+2

Se puede mostrar su 'config/database.yml'? –

+0

Mi config/database.yml está vacía. Cloné mi repositorio de un repositorio existente en github. Mi colega ha hecho que el repositorio se ejecute en heroku, así que creo que debería funcionar en mi computadora. – v4r

+3

Te recomiendo que le preguntes a tu colega sobre la configuración de la base de datos para esta aplicación. Por lo general, la aplicación Rails no se iniciará sin un archivo 'config/database.yml' válido ya que' ActiveRecord' está intentando establecer la conexión de la base de datos durante el proceso de inicialización. –

Respuesta

2

Necesita un adaptador de databse (es decir, config/database.yml).

Supongo que está utilizando Git para control de fuente por su propia seguridad. También lo ayudará a ver los cambios que ha realizado cuando sigue las instrucciones a continuación.

generar una nueva database.yml:

$ cd ~/path/to/my-existing-rails-app 
$ rails new my-existing-rails-app --database=sqlite 

Una serie de indicaciones le preguntará si desea crear/sobrescribir los archivos existentes. Siga respondiendo "NO" a las indicaciones hasta que vea una que pida crear config/database.yml. Responda "SÍ" si ve el aviso y continúe respondiendo "NO" al resto.

En vez de --database=sqlite, también puede usar --database=postgresql o --database=mysql si los ha instalado en su entorno local/de desarrollo.

Aún más, hay más opciones para --database=DATABASE

mysql 
oracle 
postgresql 
sqlite3 
frontbase 
ibm_db 
sqlserver 
jdbcmysql 
jdbcsqlite3 
jdbcpostgresql 
jdbc 
Cuestiones relacionadas