My Sinatra app was working on my local server a few days ago, but now it simply isn’t running, and all I get is a blank screen. Even when I deploy to Heroku, nothing works.
Here’s a GitHub repository where you can check out my code: https://github.com/aayalur/Sinfoursq
I think the problem is with my config.ru file.
# Gemfile
#require "rubygems"
#require "bundler/setup"
#require "sinatra"
require "./main"
set :run, false
set :raise_errors, true
run Sinatra::Application
Thanks!
You app doesn’t display anything because you haven’t closed a script tag. You would have noticed that if you inspected the DOM.
By the way, you start your app twice: once in main.rb, and then in config.ru.
You can notice that when Ctrl+C‘ing the app: it starts again and you gotta shut it down a second time.
Since your app needs to be run on Rack, get rid of the
Sinatra.run! if __FILE__ == $0and start it withrackup, as explained in Sinatra’s documentation.This will fix the problems related to running the app.