Is there a way for rubies in a rails app to support updates to a website such as Wordpress?

I have been using Wordpress for some time, it is installed on my own server, and one of the features that I like most is how every time a new version appears, it alerts you in the web admin of the application and with one click I can update the application. I do not need to approach the console.

Personally, I would not mind updating manually, but I see how this can significantly affect the adoption of a piece of software. I am working on creating a full-featured ruby ​​on the rails forum, and I would like to figure out how to enable this feature. Any ideas if this can be done using rails?

Can rails modify its own files? If this happened, would the server be rebooted?

To complicate the situation, what to do if the application has been deployed from a repo. Can a rails app check for commit after updating?

Maybe packaging the application core as a gem will be easier? Then, perhaps, the update will not actually change the MVC rails stack (the rails application will be just super-basic), instead, if the whole forum was in stone, then all he needs to do is run "gem update [name]" If this happened, I don’t think the Gemfile would even need to be updated. Will a server reboot even be required to download the updated gem?

Ideas or feedback about this?

+4
source share
1 answer

Rails files can be modified and even deleted during production - in my case, the application still works without changes, since all classes are cached in memory. This means that Rails instances must be restarted to make new changes.

I believe WordPress is Perl through CGI, and you just drop the application into the web directory so that it works immediately - the same with updates - just overwrite the files and Apache picks them up immediately.

In the case of Rails, this is something that you do not know the target deployment architecture, so restarting the application may not be trivial. For instance. with the passenger, I can just do touch tmp\restart.txt , and then all instances will be killed and restarted. For some deployments, you may need the init.d script to restart the call.

Perhaps you could recommend or prepare a ready-to-use deployment model that supports autoupdate. In other cases, users can do updates manually.

+2
source

All Articles