Can you suggest a good gem for generating word files from Rails. The main requirement is to replace some sections inside an existing template in rails.
1) You might want to use RTF templates instead. It's a format you can more easily search for your markers and modify, and Word will open it directly.
2) If RTF is insufficient, you might consider Word + VBA, and use Word's actual scripting to fill in the templates. (Perhaps also OpenOffice or a derivative.)
3) Perhaps there's something in the OpenOffice libraries which could be wrapped up into a gem to do what you want.
I used docx_replace, but found that it's not always replacing the variable names with the template values.
Note the second sentence in the description of docx_replace: "This is purposefully meant to be simple and feature-light."
The specification of the docx format is over 7,000 pages--"simple" and "complete" are incompatible goals when dealing with docx.