From the docs:
Inline templates defined in the source file that requires sinatra are automatically loaded. Call
enable :inline_templates
explicitly if you have inline templates in other source files.
In this case, when you use rackup
it is your config.ru
that calls require 'sinatra'
, and Sinatra is looking in that file for any templates, and doesn’t find any. When you run your app file directly Sinatra searches tubemp.rb
for the templates, and finds them.
To fix it, add
enable :inline_templates
to your tubemp.rb
file (and any other source files that have inline templates).