how do you effectively debug on live server in rails, whether on a beta/production server?
I tried modifying the file directly on the server, and restarting the app, but the changes does not seem to take effect, or takes a long time to (caching?)
I also tried to do “script/server production” locally, but that is very slow
The other option is to code and deploy, but that is very inefficient.
Anyone has any insights as to how they do this efficiently?
I will answer your question, even if I don’t agree with this way of hotpatching the server code 🙂
First, are you really sure that you have restarted the server? You ca check it by tailing the log files.
The view that is displayed by your changed code may be cached. The cached pages are located under
tmp/cachefolder. You can attempt to manually delete the file or you canrake tmp:cache:clearand they will all be deleted. Anyway, you can see exactly what’s happening by tailing yourlog/production.logfile (It will tell you something like ‘rendering cached …’).Another point: some data is also stored in session. You may also try to delete your session (or, delete all sessions; EG if you keep your sessions in DB, you can run
rake db:sessions:clear)