在Sinatra应用程序中插入config.ru后出现应用程序错误H10



我试图部署一个应用程序到Heroku,但是当我推我的config.ru文件时,我有错误。

跟随Heroku的日志:

2013-01-16T21:04:14+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 29160`
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:51:in `initialize'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `<main>'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/server.rb:137:in `start'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/config.ru:in `new'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/server.rb:304:in `wrapped_app'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/bin/rackup:4:in `<top (required)>'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:40:in `parse_file'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/server.rb:200:in `app'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/config.ru:in `<main>'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval'
2013-01-16T21:04:16+00:00 app[web.1]: /app/config.ru:1:in `block in <main>': undefined method `require' for #<Rack::Builder:0x0000000281d6a0 @run=nil, @map=nil, @use=[]> (NoMethodError)
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/server.rb:254:in `start'
2013-01-16T21:04:16+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `load'
2013-01-16T21:04:17+00:00 heroku[web.1]: State changed from starting to crashed
2013-01-16T21:04:17+00:00 heroku[web.1]: Process exited with status 1
2013-01-16T21:04:18+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=mazzocato.herokuapp.com fwd=201.95.41.116 dyno= queue= wait= connect= service= status=503 bytes=
2013-01-16T21:04:19+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=mazzocato.herokuapp.com fwd=201.95.41.116 dyno= queue= wait= connect= service= status=503 bytes=
2013-01-16T21:04:20+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=mazzocato.herokuapp.com fwd=201.95.41.116 dyno= queue= wait= connect= service= status=503 bytes=
2013-01-16T21:04:37+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=mazzocato.herokuapp.com fwd=201.95.41.116 dyno= queue= wait= connect= service= status=503 bytes=
2013-01-16T21:04:06+00:00 heroku[web.1]: Unidling

跟随config.ru文件:

require './app'
run Sinatra::Application

我的主文件是app.rb

帮忙吗?

(尝试将此作为注释推送…格式不好)

仅从日志中很难知道。app.rb文件中有什么内容?通常人们会这样做:

require 'rubygems'
require 'sinatra' # or Bundle.require
require 'app/mystuff'
run Sinatra::Application

但是很难知道你是否需要sinatra和其他所有东西从你的'app.rb'文件

登录到heroku,然后将dynos的数量缩放为0。保存,然后扩大规模。在我身上发生过几次,每次都有效。

相关内容

最新更新