0

我创建了一个项目。它在本地主机上工作正常,但是当我尝试在 heroku 上部署它时,它返回我“我们很抱歉,但出了点问题”。这是教程中非常简单的项目,我不知道问题出在哪里。

这是我的日志:

2013-03-22T19:31:10+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2013-03-22T19:31:10+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'
2013-03-22T19:31:10+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'
2013-03-22T19:31:10+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
2013-03-22T19:31:10+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
2013-03-22T19:31:10+00:00 app[web.1]: 
2013-03-22T19:31:10+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2013-03-22T19:31:10+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
2013-03-22T19:31:10+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
2013-03-22T19:31:10+00:00 app[web.1]: 
2013-03-22T19:31:10+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2013-03-22T19:31:10+00:00 heroku[router]: at=info method=GET path=/ host=ancient-cliffs-5913.herokuapp.com fwd="46.72.70.205" dyno=web.1 queue=0 wait=0ms connect=2ms service=18ms status=500 bytes=643
2013-03-22T19:31:10+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=ancient-cliffs-5913.herokuapp.com fwd="46.72.70.205" dyno=web.1 queue=0 wait=15ms connect=7ms service=23ms status=304 bytes=0
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/query_cache.rb:67:in `rescue in call'
2013-03-22T19:31:13+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/query_cache.rb:61:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-03-22T19:31:13+00:00 app[web.1]: 
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-03-22T19:31:13+00:00 app[web.1]: Started GET "/" for 46.72.70.205 at 2013-03-22 19:31:13 +0000
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `_run__3995827767081244094__call__3680287303298643332__callbacks'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call'
2013-03-22T19:31:13+00:00 app[web.1]: 
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2013-03-22T19:31:13+00:00 app[web.1]: 
2013-03-22T19:31:13+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
2013-03-22T19:31:13+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'
2013-03-22T19:31:13+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/query_cache.rb:67:in `rescue in call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/query_cache.rb:61:in `call'
2013-03-22T19:31:14+00:00 app[web.1]: Started GET "/" for 46.72.70.205 at 2013-03-22 19:31:14 +0000
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
2013-03-22T19:31:14+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
2013-03-22T19:31:14+00:00 app[web.1]: 
2013-03-22T19:31:14+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
2013-03-22T19:31:14+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `_run__3995827767081244094__call__3680287303298643332__callbacks'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged'
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2013-03-22T19:31:14+00:00 app[web.1]: 
2013-03-22T19:31:14+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'
2013-03-22T19:31:14+00:00 app[web.1]: 
2013-03-22T19:31:14+00:00 heroku[router]: at=info method=GET path=/ host=ancient-cliffs-5913.herokuapp.com fwd="46.72.70.205" dyno=web.1 queue=0 wait=11ms connect=22ms service=20ms status=500 bytes=643
2013-03-22T19:31:13+00:00 heroku[router]: at=info method=GET path=/ host=ancient-cliffs-5913.herokuapp.com fwd="46.72.70.205" dyno=web.1 queue=0 wait=0ms connect=10ms service=5ms status=500 bytes=643

这是我的宝石文件:

source 'https://rubygems.org'

gem 'rails', '3.2.12'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

group :development, :test do
  gem 'sqlite3-ruby', :require => 'sqlite3'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
group :test do
  gem 'rspec-rails', '2.6.1'
  gem 'webrat', '0.7.1'
end
4

1 回答 1

3

你没有

gem 'pg' 

在您的 Gemfile 中。您可以继续在本地使用 sqlite3 进行开发,但您需要在 Heroku 上使用 postgres、mysql、mongo。

于 2013-03-22T19:46:04.307 回答