The error looks like it is from Sinatra being unable to find a Slim template when rendering a response, because it’s looking for a views
directory under the config
directory. By default Sinatra looks for the views dir relative to the application file, which (again by default) is the file that calls require 'sinatra'
. In your case the require line is in config/environment.rb
so Sinatra treats that as the app file and looks for the views
dir below it.
I’m assuming you have an actual application file that you haven’t shown. The simplest solution is probably to explicitly set the application file setting in there:
set :app_file, __FILE__
Depending on your setup you might want to specify the view directory directly instead:
set :views, 'path/to/views'