Skip to content

Instantly share code, notes, and snippets.

@hahmed
Created October 31, 2015 11:43
Show Gist options
  • Select an option

  • Save hahmed/53d7889a6a9bfa14de14 to your computer and use it in GitHub Desktop.

Select an option

Save hahmed/53d7889a6a9bfa14de14 to your computer and use it in GitHub Desktop.
Sinatra app on heroku failing...

Gemfile

source "https://rubygems.org"
ruby "2.2.3"

gem 'sinatra'
gem 'thin'

Procfile

web: bundle exec rackup config.ru -p $PORT

config.ru

require './application'
# set :root, settings.root
# set :views, settings.root + '/views'
run Sinatra::Application

application.rb

require 'sinatra'
#set :root, File.dirname(__FILE__)

get '/' do
  erb :index
end

views are in the folder /views/index.erb

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- These meta tags come first. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Bootstrap Theme Example</title>

  </head>
  <body>
    <h1>Hello, world!</h1>
    <!-- Include jQuery (required) and the JS -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  </body>
</html>
@hahmed
Copy link
Author

hahmed commented Oct 31, 2015

2015-10-31T11:27:46.037978+00:00 heroku[slug-compiler]: Slug compilation started
2015-10-31T11:27:46.037983+00:00 heroku[slug-compiler]: Slug compilation finished
2015-10-31T11:27:45.880971+00:00 heroku[api]: Deploy 67bf587 by [email protected]
2015-10-31T11:27:45.880971+00:00 heroku[api]: Release v13 created by [email protected]
2015-10-31T11:27:46.254629+00:00 heroku[web.1]: State changed from crashed to starting
2015-10-31T11:27:47.186730+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 58624`
2015-10-31T11:27:48.853612+00:00 heroku[web.1]: State changed from starting to up
2015-10-31T11:44:48.578372+00:00 heroku[router]: at=info method=GET path="/" host=fast-castle-1519.herokuapp.com request_id=e2d1e3f4-0c75-4a25-b33f-07a655954e97 fwd="82.9.37.189" dyno=web.1 connect=1ms service=9ms status=500 bytes=255
2015-10-31T11:44:48.439791+00:00 app[web.1]: 2015-10-31 11:44:48 - Errno::ENOENT - No such file or directory @ rb_sysopen - /app/views/index.erb:
2015-10-31T11:44:48.439826+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/tilt-2.0.1/lib/tilt/template.rb:210:in `initialize'
2015-10-31T11:44:48.439828+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/tilt-2.0.1/lib/tilt/template.rb:210:in `open'
2015-10-31T11:44:48.439829+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/tilt-2.0.1/lib/tilt/template.rb:210:in `read_template_file'
2015-10-31T11:44:48.439829+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/tilt-2.0.1/lib/tilt/template.rb:76:in `block in initialize'
2015-10-31T11:44:48.439830+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/tilt-2.0.1/lib/tilt/template.rb:77:in `call'
2015-10-31T11:44:48.439831+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/tilt-2.0.1/lib/tilt/template.rb:77:in `initialize'
2015-10-31T11:44:48.439832+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:861:in `new'
2015-10-31T11:44:48.439832+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:861:in `block in compile_template'
2015-10-31T11:44:48.439833+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/tilt-2.0.1/lib/tilt.rb:88:in `fetch'
2015-10-31T11:44:48.439833+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:840:in `compile_template'
2015-10-31T11:44:48.439834+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:821:in `render'
2015-10-31T11:44:48.439834+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:666:in `erb'
2015-10-31T11:44:48.439835+00:00 app[web.1]:    /app/application.rb:5:in `block in <top (required)>'
2015-10-31T11:44:48.439835+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
2015-10-31T11:44:48.439835+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
2015-10-31T11:44:48.439836+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `[]'
2015-10-31T11:44:48.439836+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (3 levels) in route!'
2015-10-31T11:44:48.439837+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:993:in `route_eval'
2015-10-31T11:44:48.439837+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (2 levels) in route!'
2015-10-31T11:44:48.439838+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
2015-10-31T11:44:48.439838+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
2015-10-31T11:44:48.439838+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
2015-10-31T11:44:48.439839+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:972:in `block in route!'
2015-10-31T11:44:48.439839+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `each'
2015-10-31T11:44:48.439839+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `route!'
2015-10-31T11:44:48.439840+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1084:in `block in dispatch!'
2015-10-31T11:44:48.439840+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
2015-10-31T11:44:48.439841+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
2015-10-31T11:44:48.439841+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
2015-10-31T11:44:48.439841+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in `dispatch!'
2015-10-31T11:44:48.439842+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
2015-10-31T11:44:48.439842+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
2015-10-31T11:44:48.439842+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
2015-10-31T11:44:48.439843+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
2015-10-31T11:44:48.439843+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
2015-10-31T11:44:48.439843+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
2015-10-31T11:44:48.439844+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
2015-10-31T11:44:48.439844+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
2015-10-31T11:44:48.439845+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
2015-10-31T11:44:48.439845+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2015-10-31T11:44:48.439845+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2015-10-31T11:44:48.439846+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
2015-10-31T11:44:48.439846+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/logger.rb:15:in `call'
2015-10-31T11:44:48.439850+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
2015-10-31T11:44:48.439851+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
2015-10-31T11:44:48.439851+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:211:in `call'
2015-10-31T11:44:48.439852+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
2015-10-31T11:44:48.439852+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
2015-10-31T11:44:48.439853+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
2015-10-31T11:44:48.439853+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
2015-10-31T11:44:48.439853+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
2015-10-31T11:44:48.439854+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
2015-10-31T11:44:48.439854+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
2015-10-31T11:44:48.439855+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:86:in `block in pre_process'
2015-10-31T11:44:48.439855+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:84:in `catch'
2015-10-31T11:44:48.439855+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:84:in `pre_process'
2015-10-31T11:44:48.439856+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:53:in `process'
2015-10-31T11:44:48.439856+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:39:in `receive_data'
2015-10-31T11:44:48.439856+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.0.8/lib/eventmachine.rb:193:in `run_machine'
2015-10-31T11:44:48.439857+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.0.8/lib/eventmachine.rb:193:in `run'
2015-10-31T11:44:48.439857+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/thin-1.6.4/lib/thin/backends/base.rb:73:in `start'
2015-10-31T11:44:48.439857+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/thin-1.6.4/lib/thin/server.rb:162:in `start'
2015-10-31T11:44:48.439858+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/handler/thin.rb:19:in `run'
2015-10-31T11:44:48.439858+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
2015-10-31T11:44:48.439858+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:147:in `start'
2015-10-31T11:44:48.439859+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/bin/rackup:4:in `<top (required)>'
2015-10-31T11:44:48.439859+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/bin/rackup:23:in `load'
2015-10-31T11:44:48.439860+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/bin/rackup:23:in `<main>'
2015-10-31T11:44:48.443195+00:00 app[web.1]: 82.9.37.189 - - [31/Oct/2015:11:44:48 +0000] "GET / HTTP/1.1" 500 30 0.0048
2015-10-31T11:44:48.857180+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=fast-castle-1519.herokuapp.com request_id=68ad20fc-b49f-4667-9af6-41f4cc6c238c fwd="82.9.37.189" dyno=web.1 connect=1ms service=1ms status=404 bytes=248
2015-10-31T11:44:48.726528+00:00 app[web.1]: 82.9.37.189 - - [31/Oct/2015:11:44:48 +0000] "GET /favicon.ico HTTP/1.1" 404 18 0.0006

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment