Redmine Plugin - requires restart after every code change

为君一笑 提交于 2019-12-07 09:48:00

问题


I am working on some plugin on redmine (project management web application written using Ruby on Rail).

For every change i make to the code of the plugin(say view.html.erb file), i have to restart the redmine(application) server. This is because, it runs on production mode by default.

Will running the application on development mode, solve this problem?

If yes, how can i change its running mode or over-ride this behavior so that classes are loaded per every request (yes this will not be efficient but will be good for development) and changes to the code reflect without restarting the application application server(redmine in this case)

I tried adding this line to environment.rb file

ENV['RAILS_ENV'] ||= 'development'

Also tried answers/comments posted below, but they did'nt solve my problem.

Any working solution would be of great help.

Thank You.

Other Related information:

It uses Rails 2.3.14 and its installed using bitnami stack


回答1:


For automatic plugin reload on Rails 2.3:

Add config.reload_plugins = true on config/environment.rb. It has to be there, you can't put it on config/environments/development.rb due to the Rails start up steps. You may add if RAILS_ENV = 'development' instead.

config/environment.rb

config.reload_plugins = true  

On the plugin's init.rb, add the following line: init.rb

ActiveSupport::Dependencies.explicitly_unloadable_constants = 'YourPluginModuleName' 

That's all. Don't forget to remove it when you're done.



来源:https://stackoverflow.com/questions/9289486/redmine-plugin-requires-restart-after-every-code-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!