Reloading not working for some reason.

12 views
Skip to first unread message

Tim Uckun

unread,
Oct 10, 2017, 5:02:22 AM10/10/17
to sina...@googlegroups.com
I have an app I am writing but the reloading doesn't seem to work right.

The file looks like this.

require 'sinatra'
#sinatra contrib namespaces conflict with rake namespaces so we have to include it here.
# TODO: This might be fixed by going the class way of doing these routes.
require 'sinatra/contrib'
#these need to be required in order

require_relative 'config/environment'
require_relative 'config/database_settings'
require_relative 'config/middlewares'
require_relative 'config/sinatra_settings'

require_relative 'lib/lib'
require_relative 'app/models'
require_relative 'app/helpers'
require_relative 'app/routes'


In the sinatra settings file I have this

configure :development do
register Sinatra::Reloader
use ::BetterErrors::Middleware
# you need to set the application root in order to abbreviate filenames
# within the application:
::BetterErrors.application_root = settings.root

after_reload do
puts 'reloaded'
end
end



This does not work. The app doesn't reload when I change one of the files in the routes directory.

The app/routes file requires all the individual route files so could that be the problem?


Reply all
Reply to author
Forward
0 new messages