How is it possible to force reloading a gem for every request?
I develop a gem and would like to reload my gem’s code every time when I refresh the page in a browser. My Gemfile:
gem "my_gem", :path => "../my_gem"
To solve the problem I tried every suggestion listed in stakoverflow. Nothing helped. Also have found two Rails config parameters: watchable_dirs and watchable_files. Tried to use them but they also don’t work for me.
You should mark the classes you want to reload as unloadable using ActiveSupport::Dependencies unloadable method;
http://apidock.com/rails/ActiveSupport/Dependencies/Loadable/unloadable and
http://robots.thoughtbot.com/post/159805560/tips-for-writing-your-own-rails-engine
should give you some background. Alternatively you can do your own reloading like this;