When calling sinatra itself, $ ruby tubemp.rb
works. But via rackup
it does not. The application, somehow cannot find the inline templates.
#config.ru
require 'rubygems'
require 'sinatra'
set :environment, ENV['RACK_ENV'].to_sym
disable :run, :reload
require './tubemp.rb'
run Sinatra::Application
The error being returned is:
No such file or directory - /home/ber/Documenten/ET_tubemp/code/views/index.erb:
Relevant part from tubemp.rb
get '/' do
#...
erb :index
end
__END__
@@ layout
<html>
...
<%= yield %>
@@ index
Welcome!
Somehow, via rackup, it expects the views to live in actual view-files. I guess the rackup cannot handle the __END__
token when including or so.
How should I deal with this, other then moving my templates into template files?