我试图将应用程序部署到 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
有什么帮助吗?