Redmine Plugin - restart required after each code change

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

For every change I make to the plugin code (for example, the view.html.erb file), I need to restart the redmine (application) server. This is due to the fact that by default it works in production mode.

Run the application in development mode, solve this problem?

If so, how can I change its operating mode or override this behavior so that classes are loaded for each request (yes, it will be inefficient, but will be useful for development), and changes in the code reflect the application application server without restarting (redmine in this case)

I tried adding this line to the environment.rb file

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

Also tried the answers / comments posted below, but they did not solve my problem.

Any working solution would be very helpful.

Thanks.

Other Related Information:

It uses Rails 2.3.14 and is installed using bitpacks.

+4
source share
1 answer

To automatically reload plugins on Rails 2.3:

Add config.reload_plugins = true to config / environment.rb. It should be there, you cannot put it on config/environments/development.rb because of the steps to run Rails. Instead, you can add if RAILS_ENV = 'development' .

config / environment.rb

 config.reload_plugins = true 

In the init.rb plugin, add the following line: init.rb

 ActiveSupport::Dependencies.explicitly_unloadable_constants = 'YourPluginModuleName' 

It's all. Remember to remove it when done.

+3
source

Source: https://habr.com/ru/post/1396572/


All Articles