obteniendo un mensaje de error al iniciar la consola de rieles:

Hi there Im trying to start rails console so I typed "rails console" at the command line and I get this error message on the console

/Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in `resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:39:in `resolve_string_connection'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:23:in `spec'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:127:in `establish_connection'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/railtie.rb:76:in `block (2 levels) in <class:Railtie>'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/base.rb:716:in `<top (required)>'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/railtie.rb:41:in `block in <class:Railtie>'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/railtie.rb:179:in `call'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/railtie.rb:179:in `block in load_console'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/railtie.rb:179:in `each'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/railtie.rb:179:in `load_console'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/engine.rb:429:in `block in load_console'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application/railties.rb:8:in `each'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application/railties.rb:8:in `all'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/engine.rb:429:in `load_console'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application.rb:153:in `load_console'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands/console.rb:27:in `start'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

Seems like it cant find the database adapter. Any I dea how to resolve this? Much appreciated

Here is the database.yml file:

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'

#==============================================================================
Listings_development:
  adapter: sqlite3
  database: db/Listings.sqlite3
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
Listings_test:
  adapter: sqlite3
  database: db/Listings.sqlite3
  pool: 5
  timeout: 5000

Listings_production:
  adapter: sqlite3
  database: db/Listings.sqlite3
  pool: 5
  timeout: 5000

Here are the gems installed:

Gems included by the bundle: * actionmailer (3.2.1) * actionpack (3.2.1) * activemodel (3.2.1) * activerecord (3.2.1) * activeresource (3.2.1) * activesupport (3.2.1) * arel (3.0.2) * builder (3.0.0) * bundler (1.0.22) * coffee-rails (3.2.2) * coffee-script (2.2.0) * coffee-script-source (1.2.0) * erubis (2.7.0) * execjs (1.3.0) * hike (1.2.1) * i18n (0.6.0) * journey (1.0.3) * jquery-rails (2.0.1) * json (1.6.5) * mail (2.4.3) * mime-types (1.17.2) * multi_json (1.1.0) * polyglot (0.3.3) * rack (1.4.1) * rack-cache (1.2) * rack-ssl (1.3.2) * rack-test (0.6.1) * rails (3.2.1) * railties (3.2.1) * rake (0.9.2.2) * rdoc (3.12) * sass (3.1.15) * sass-rails (3.2.4) * sprockets (2.1.2) * sqlite3 (1.3.5) * thor (0.14.6) * tilt (1.3.3) * treetop (1.4.10) * tzinfo (0.3.32) * uglifier (1.2.3)

preguntado el 10 de marzo de 12 a las 14:03

'bundle install' command, make sure that all gems are installed -

What does your database.yml file look like? And are you missing the database connector for whatever is default in your dev environment? -

@Marc Talbot please see updated post. I have added the database.yml file up above. Thanks -

@megas, please see the updated post above with a listing of gems installed Thanks -

2 Respuestas

You need an environment called "development," not "Listings_development." Rename your environment and try starting the console again.

respondido 10 mar '12, 15:03

What exactly is Listings_development: and Listings_production:. In case u try to start it the default behaviour is to look for development: and production: in your db. That's what rails says "Convention over Configuration". Also the names are case sensitive

Is the server running with no issues?

respondido 10 mar '12, 16:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.