我收到一个错误:当我在浏览器中查看应用程序时,ActiveRecord :: ConnectionNotEstablished(完整跟踪) . 我似乎无法弄清楚如何解决这个问题 . 我尝试了下面提到的项目:

这里http://www.benjaminoakes.com/2011/09/15/activerecordconnectionnotestablished-in-rails-3-1-on-heroku/

以及stackoverflow.com/questions/7871233/ruby-activerecordconnectionnotestablished

在这里www.ruby-forum.com/topic/2854331

和其他多个人

(仅供参考,我在Windows 7上运行,Ruby 1.9.3,没有RVM)我的代码在这里可用:https://github.com/justjoehere/sample_app

任何帮助将不胜感激

我的Gemfile

source 'https://rubygems.org'
gem 'rails', '3.2.13'
group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.9.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails', '3.2.4'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.2.1'
group :test do
  gem 'capybara', '1.1.2'
end
group :production do
  gem 'pg', '0.12.2'
end

数据库yaml文件

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.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.
test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

跟踪:

activerecord(3.2.13)lib / active_record / connection_adapters / abstract / connection_pool.rb:410:在retrieve_connection'activerecord(3.2.13)lib / active_record / connection_adapters / abstract / connection_specification.rb:171:在retrieve_connection'activerecord中(3.2.13)lib / active_record / connection_adapters / abstract / connection_specification.rb:145:在connection'activerecord(3.2.13)lib / active_record / query_cache.rb:67:在rescue in call'activerecord(3.2.13) )lib / active_record / query_cache.rb:61:在call'activerecord(3.2.13)lib / active_record / connection_adapters / abstract / connection_pool.rb:479:在call'actionpack(3.2.13)lib / action_dispatch / middleware /callbacks.rb:28:inclock in call'activesupport(3.2.13)lib / active_support / callbacks.rb:405:inrun_133064122_call_765555415__callbacks'activesupport(3.2.13)lib / active_support / callbacks.rb:405:in __run_callback'activesupport(3.2.13)lib / active_support / callbacks.rb:385:in_run_call_callbacks'activesupport(3.2.13)lib / active_sup port / callbacks.rb:81:在run_callbacks'actionpack(3.2.13)lib / action_dispatch / middleware / callbacks.rb:27:在call'actionpack(3.2.13)lib / action_dispatch / middleware / reloader.rb: 65:在call'actionpack(3.2.13)lib / action_dispatch / middleware / remote_ip.rb:31:在call'actionpack(3.2.13)lib / action_dispatch / middleware / debug_exceptions.rb:16:在call'中actionpack(3.2.13)lib / action_dispatch / middleware / show_exceptions.rb:56:在call'railties(3.2.13)lib / rails / rack / logger.rb:32:在call_app'railties(3.2.13) lib / rails / rack / logger.rb:16:在block in call'activesupport(3.2.13)lib / active_support / tagged_logging.rb:22:intagged'railties(3.2.13)lib / rails / rack / logger.rb:16:在call'actionpack(3.2.13)lib / action_dispatch / middleware / request_id.rb:22:在call'rack(1.4.5)lib / rack / methodoverride.rb:21:in调用'rack(1.4.5)lib / rack / runtime.rb:17:在call'activesupport(3.2.13)lib / active_support / cache / strategy / local_cache.rb:72:在call'rack(1.4 . 5)lib / rack / lock.rb:15:在call'ac中tionpack(3.2.13)lib / action_dispatch / middleware / static.rb:63:在call'railties(3.2.13)lib / rails / engine.rb:479:在call'railties(3.2.13)lib / rails / application.rb:223:在call'rack(1.4.5)lib / rack / content_length.rb:14:在call'railties(3.2.13)lib / rails / rack / log_tailer.rb:17:在call'rack(1.4.5)lib / rack / handler / webrick.rb:59:inservice'C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138 :在service'C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:在run'C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1 /webrick/server.rb:191:在start_thread中的`block'