Reputation: 153
Any idea why Webrick refuses to start?
require 'sinatra/base'
require 'slim'
class Blog < Sinatra::Base
get '/' do
slim :home
end
end
Running ruby blog.rb
does nothing. No error is raised.
Upvotes: 0
Views: 479
Reputation: 79733
The built in web server isn’t started when using the modular style of Sinatra apps. See the docs for the differences between modular and classic styles.
To get it to run like a classic style app, add this line to the bottom of your Blog
class:
run! if app_file == $0
Upvotes: 1