0

我在rails 3.2.1上运行。我在已部署的应用程序上收到以下消息:我们很抱歉,但出了点问题。

我真的不知道是什么导致了这个错误。

这是我的heroku日志。

Invalid gemspec in [C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/specificatio
ns/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
2013-02-01T12:53:55+00:00 app[web.1]: [2013-02-01 12:53:55] INFO  WEBrick::HTTPS
erver#start: pid=2 port=47478
2013-02-01T12:53:58+00:00 app[web.1]:
2013-02-01T12:53:58+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (Ac
tiveRecord::ConnectionNotEstablished):
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:i
n `retrieve_connection'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification
.rb:168:in `retrieve_connection'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification
.rb:142:in `connection'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/query_cache.rb:67:in `rescue in call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/query_cache.rb:61:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:443:i
n `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/callbacks.rb:405:in `_run__3328337976595330500__cal
l__2238187366165653971__callbacks'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/rack/logger.rb:26:in `call_app'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/rack/logger.rb:16:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/methodoverride.rb:21:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/runtime.rb:17:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/lock.rb:15:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/static.rb:53:in `call'
2013-02-01T12:53:58+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-02-01T12:53:58+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-02-01T12:53:58+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-02-01T12:53:58+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-02-01T12:53:58+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-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/engine.rb:479:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/application.rb:220:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/content_length.rb:14:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/rack/log_tailer.rb:14:in `call'
2013-02-01T12:53:58+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/handler/webrick.rb:59:in `service'
2013-02-01T12:53:58+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpse
rver.rb:111:in `service'
2013-02-01T12:53:58+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpse
rver.rb:70:in `run'
2013-02-01T12:53:58+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server
.rb:183:in `block in start_thread'
2013-02-01T12:53:58+00:00 app[web.1]:
2013-02-01T12:53:58+00:00 app[web.1]:
2013-02-01T12:53:58+00:00 app[web.1]: cache: [GET /pages/home] miss
2013-02-01T12:53:58+00:00 heroku[router]: at=info method=GET path=/pages/home ho
st=evening-caverns-5777.herokuapp.com fwd=82.207.20.180 dyno=web.1 queue=0 wait=
0ms connect=4ms service=519ms status=500 bytes=643
2013-02-01T12:53:47+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-02-01T12:53:48+00:00 app[web.1]: [2013-02-01 12:53:48] ERROR SignalExceptio
n: SIGTERM
2013-02-01T12:53:48+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server
.rb:90:in `select'
2013-02-01T12:53:58+00:00 heroku[web.1]: Stopping remaining processes with SIGKI
LL
2013-02-01T12:54:00+00:00 heroku[web.1]: Process exited with status 137
2013-02-01T12:53:58+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least on
e process failed to exit within 10 seconds of SIGTERM
2013-02-01T12:57:46+00:00 heroku[api]: Starting process with command `bundle exe
c rake db:reset` by marik.expert@gmail.com
2013-02-01T12:57:59+00:00 heroku[run.1710]: State changed from up to complete
2013-02-01T12:57:58+00:00 heroku[run.1710]: Client connection closed. Sending SI
GHUP to all processes
2013-02-01T12:57:52+00:00 heroku[run.1710]: Awaiting client
2013-02-01T12:57:52+00:00 heroku[run.1710]: Starting process with command `bundl
e exec rake db:reset`
2013-02-01T12:57:59+00:00 heroku[run.1710]: Process exited with status 1
2013-02-01T12:57:53+00:00 heroku[run.1710]: State changed from starting to up
2013-02-01T13:00:50+00:00 app[web.1]:
2013-02-01T13:00:50+00:00 app[web.1]: Started GET "/pages/home" for 82.207.20.18
0 at 2013-02-01 13:00:50 +0000
2013-02-01T13:00:50+00:00 app[web.1]:
2013-02-01T13:00:50+00:00 app[web.1]:
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification
.rb:142:in `connection'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/rack/logger.rb:16:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/runtime.rb:17:in `call'
2013-02-01T13:00:50+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (Ac
tiveRecord::ConnectionNotEstablished):
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/methodoverride.rb:21:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/callbacks.rb:405:in `_run__3328337976595330500__cal
l__2238187366165653971__callbacks'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/static.rb:53:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/lock.rb:15:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/query_cache.rb:67:in `rescue in call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/query_cache.rb:61:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:i
n `retrieve_connection'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification
.rb:168:in `retrieve_connection'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupp
ort-3.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-02-01T13:00:50+00:00 heroku[router]: at=info method=GET path=/pages/home ho
st=evening-caverns-5777.herokuapp.com fwd=82.207.20.180 dyno=web.1 queue=0 wait=
0ms connect=3ms service=8ms status=500 bytes=643
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/rack/logger.rb:26:in `call_app'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activereco
rd-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:443:i
n `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack
-3.2.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-02-01T13:00:50+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-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/application.rb:220:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/rack/log_tailer.rb:14:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server
.rb:183:in `block in start_thread'
2013-02-01T13:00:50+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-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3
.2.1/lib/rails/engine.rb:479:in `call'
2013-02-01T13:00:50+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-02-01T13:00:50+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-02-01T13:00:50+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-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/content_length.rb:14:in `call'
2013-02-01T13:00:50+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpse
rver.rb:111:in `service'
2013-02-01T13:00:50+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/httpse
rver.rb:70:in `run'
2013-02-01T13:00:50+00:00 app[web.1]:
2013-02-01T13:00:50+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.4
/lib/rack/handler/webrick.rb:59:in `service'
2013-02-01T13:00:50+00:00 app[web.1]:
2013-02-01T13:00:50+00:00 app[web.1]: cache: [GET /pages/home] miss

我的宝石文件:

    source 'https://rubygems.org'

gem 'rails', '3.2.1'

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

gem 'sqlite3', :group => :development

group :development do
        gem 'rspec-rails', '2.6.1'
end

group :test do
        gem 'rspec-rails', '2.6.1'
        gem 'webrat', '0.7.1'
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 runtim
  # gem 'therubyracer'

  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 web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

如何解决问题?

4

3 回答 3

0

您的应用程序需要一个数据库连接,但您没有指定适当的适配器。如果你使用 Heroku Postgres,你需要添加类似的东西gem 'pg', :group => :production并确保你DATABASE_URL的 Heroku 配置中有一个。

于 2013-02-01T20:27:30.117 回答
0

好吧,有一件事,没有数据库适配器被传递给 Heroku。确保你的 heroku 应用有一个数据库,一个

于 2013-02-01T14:33:40.077 回答
0

您需要在 Gemfile 的生产环境中添加 pg gem。

  group :production
    gem 'pg'
  end

然后运行

  heroku rake db:migrate   #create db tables for production

 git push heroku master    #pushed the latest changes to production

 heroku restart        # it will start the server again with new changes

它现在应该可以工作了。

于 2015-02-03T11:31:44.600 回答