简体   繁体   English

Redmine插件 - 每次代码更改后都需要重启

[英]Redmine Plugin - requires restart after every code change

I am working on some plugin on redmine (project management web application written using Ruby on Rail). 我正在研究redmine上的一些插件(使用Ruby on Rail编写的项目管理Web应用程序)。

For every change i make to the code of the plugin(say view.html.erb file), i have to restart the redmine(application) server. 对于我对插件代码所做的每一个更改(比如view.html.erb文件),我必须重新启动redmine(应用程序)服务器。 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) 如果是,我如何更改其运行模式或覆盖此行为,以便每个请求加载类(是的,这将不是有效的,但将有利于开发)并且代码的更改反映而无需重新启动应用程序应用程序服务器(在这种情况下redmine)

I tried adding this line to environment.rb file 我尝试将此行添加到environment.rb文件中

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 它使用Rails 2.3.14并使用bitnami堆栈安装

For automatic plugin reload on Rails 2.3: 对于Rails 2.3上的自动插件重新加载:

Add config.reload_plugins = true on config/environment.rb. 在config / environment.rb上添加config.reload_plugins = true It has to be there, you can't put it on config/environments/development.rb due to the Rails start up steps. 它必须在那里,你不能把它放在config/environments/development.rb因为Rails启动步骤。 You may add if RAILS_ENV = 'development' instead. if RAILS_ENV = 'development'您可以添加。

config/environment.rb 到config / environment.rb

config.reload_plugins = true  

On the plugin's init.rb, add the following line: init.rb 在插件的init.rb上,添加以下行:init.rb

ActiveSupport::Dependencies.explicitly_unloadable_constants = 'YourPluginModuleName' 

That's all. 就这样。 Don't forget to remove it when you're done. 完成后别忘了将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM