简体   繁体   中英

Trouble deploying a Sinatra application on Heroku

I am new to the Ruby and Heroku world and I am trying to deploy a very basic Sinatra app on heroku. I have the following files:

config.ru:

require './hi'
run Sinatra::Application

hi.rb:

require 'rubygems'
require 'sinatra'

get '/' do
  "Hello from Sinatra on Heroku!"
end

.gems

sinatra

When push to heroku and launch the app it crashes with the following entry in the logs:

2011-05-03T05:52:02+00:00 app[web.1]: /app/.gems/gems/sinatra-1.2.5/lib/sinatra/base.rb:1144:in `define_method': tried to create Proc object without a block (ArgumentError)
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/sinatra-1.2.5/lib/sinatra/base.rb:1144:in `compile!'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/sinatra-1.2.5/lib/sinatra/base.rb:1129:in `route'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/sinatra-1.2.5/lib/sinatra/base.rb:1111:in `get'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/sinatra-1.2.5/lib/sinatra/base.rb:1474:in `send'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/sinatra-1.2.5/lib/sinatra/base.rb:1474:in `get'
2011-05-03T05:52:02+00:00 app[web.1]:   from ./hi.rb:4
2011-05-03T05:52:02+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2011-05-03T05:52:02+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-05-03T05:52:02+00:00 app[web.1]:   from config.ru:1
2011-05-03T05:52:02+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/rack-1.2.2/lib/rack/builder.rb:63:in `new'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/rack-1.2.2/lib/rack/builder.rb:63:in `map'
2011-05-03T05:52:02+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-05-03T05:52:02+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `new'
2011-05-03T05:52:02+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-05-03T05:52:02+00:00 app[web.1]:   from /app/.gems/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-05-03T05:52:02+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-05-03T05:52:02+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-05-02T22:52:03-07:00 heroku[web.1]: State changed from starting to crashed

Any help would be appreciated.

Problem was sinatra - they updated it, so now everything running smoothly on 1.2.6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM