ActiveRecord :: ConnectionNotEstablished sample_app RoR Hartl

时间:2013-08-29 20:18:12

标签: ruby-on-rails ruby ruby-on-rails-3 activerecord ruby-on-rails-3.2

我收到一个错误:当我在浏览器中查看应用程序时,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:in“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:in`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:in block in call'

     

activesupport(3.2.13)lib / active_support / callbacks.rb:405:在`运行 _133064122_ 调用 _765555415__callbacks'

     

activesupport(3.2.13)lib / active_support / callbacks.rb:405:在`__run_callback'

     

activesupport(3.2.13)lib / active_support / callbacks.rb:385:in`_run_call_callbacks'

     

activesupport(3.2.13)lib / active_support / callbacks.rb:81:在`run_callbacks'

     

actionpack(3.2.13)lib / action_dispatch / middleware / callbacks.rb:27:in`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:in`call'

     

actionpack(3.2.13)lib / action_dispatch / middleware / debug_exceptions.rb:16:in`call'

     

actionpack(3.2.13)lib / action_dispatch / middleware / show_exceptions.rb:56:in`call'

     

railties(3.2.13)lib / rails / rack / logger.rb:32:in`call_app'

     

railties(3.2.13)lib / rails / rack / logger.rb:16:in"clock in call'

     

activesupport(3.2.13)lib / active_support / tagged_logging.rb:22:in"tagged'

     

railties(3.2.13)lib / rails / rack / logger.rb:16:in`call'

     

actionpack(3.2.13)lib / action_dispatch / middleware / request_id.rb:22:in`call'

     

rack(1.4.5)lib / rack / methodoverride.rb:21:在`call'

     

rack(1.4.5)lib / rack / runtime.rb:17:在`call'

     

activesupport(3.2.13)lib / active_support / cache / strategy / local_cache.rb:72:in`call'

     

rack(1.4.5)lib / rack / lock.rb:15:在`call'

     

actionpack(3.2.13)lib / action_dispatch / middleware / static.rb:63:in`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:in`call'

     

rack(1.4.5)lib / rack / handler / webrick.rb:59:in“service”

     

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:in"run'

     

C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:在“start_thread中的块”中

0 个答案:

没有答案