Problem deploying simple ruby sinatra app on heroku -
i new ruby, git , heroku. trying build simple hello world app , deploy on heroku. see following error in logs when try access site using heroku provided url. tell me not doing right.
2011-07-03t01:15:06+00:00 app[web.1]: /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval' 2011-07-03t01:15:06+00:00 app[web.1]: /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize' 2011-07-03t01:15:06+00:00 app[web.1]: /home/heroku_rack/heroku.ru:1:in `new' 2011-07-03t01:15:06+00:00 app[web.1]: /home/heroku_rack/heroku.ru:1:in `<main>' 2011-07-03t01:15:06+00:00 app[web.1]: /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `eval' 2011-07-03t01:15:06+00:00 app[web.1]: /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:175:in `load_rackup_config' 2011-07-03t01:15:06+00:00 app[web.1]: /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `load' 2011-07-03t01:15:06+00:00 app[web.1]: /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:65:in `start' 2011-07-03t01:15:06+00:00 app[web.1]: /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:177:in `run_command' 2011-07-03t01:15:06+00:00 heroku[web.1]: process exited 2011-07-03t01:15:07+00:00 heroku[web.1]: state changed starting crashed
config.ru file
require 'myapp2' run sinatra::application
myapp2.rb
require 'rubygems' require 'sinatra' '/' 'hello world' end
you're missing top of stack trace, looks problem require
.
in config.ru
change
require 'myapp2'
to
require './myapp2'
or
require file.expand_path("../myapp2", __file__)
ruby 1.9.2 no longer has current directory in load path, require 'myapp2'
isn't able find app file in same directory.
if working on local machine, not on heroku, you're using different version of ruby, 1.8.7. idea install 1.9.2 locally you're using same version in development , production. alternatively change heroku stack you're using; have @ the heroku stack docs
Comments
Post a Comment