You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear Mr. John Dugan. I am not able to generate documents on production environment on Heroku. I've created a helper that is called from a view and generate my document. On development environment, in my local puma server, all works fine, but after I've deployed my app on Heroku and tryed to save the document nothing happens! Thank you for your time!!!
My helper method to generate docx file:
moduleDrawMapsHelperdefbuild_map_document(draw_map)filename="meu_mapa_#{DateTime.now.to_s}.docx"Caracal::Document.save"#{filename}"do |docx|
docx.p'Estudo Numerológico Pessoal'docolor'd11a11'size24boldtruealign'center'enddocx.p'(Mapa Numerológico)'docolor'd11a11'size24boldtruealign'center'brenddocx.p'Índice'docolor'd11a11'size24boldtruealign'left'enddraw_map.index.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Orientação'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.guidance_prefacedocolor'000000'size18italictruealign'both'brbrenddocx.pdraw_map.guidance_explanationdocolor'000000'size18align'both'brenddocx.p'Importante'docolor'd11a11'size24boldtruealign'left'brenddraw_map.guidance_warning.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Os seus Números'docolor'd11a11'size24boldtruealign'left'brenddraw_map.your_numbers.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Motivação'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.motivation_explanationdocolor'000000'size18align'both'italictruebrenddocx.pdraw_map.motivation.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.motivation.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pagedocx.p'Impressão'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.impression_explanationdocolor'000000'size18align'both'italictruebrenddocx.pdraw_map.impression.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.impression.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pagedocx.p'Expressão'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.expression_explanationdocolor'000000'size18align'both'italictruebrenddocx.pdraw_map.expression.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.expression.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pagedocx.p'Cores que melhor se harmonizam com seu Dia de Nascimento'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.colors_explanationdocolor'000000'size18align'both'italictruebrenddraw_map.colors.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pagedocx.p'Destino'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.destiny_explanationdocolor'000000'size18align'both'italictruebrenddocx.pdraw_map.destiny.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.destiny.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pagedocx.p'Missão'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.mission_explanationdocolor'000000'size18align'both'italictruebrenddocx.pdraw_map.mission.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.mission.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pdotext''brenddocx.p'Seu Anjo'docolor'd11a11'size24boldtruealign'left'brenddraw_map.angel.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pdotext''brenddocx.p'Lições Cármicas'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.karmic_lessons_explanationdocolor'000000'size18align'both'italictruebrenddocx.pdraw_map.karmic_lessons.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.karmic_lessons.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Dívidas Cármicas'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.karmic_debts_explanationdocolor'000000'size18align'both'italictruebrenddraw_map.karmic_debts.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Tendências Ocultas'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.hidden_trends_explanationdocolor'000000'size18align'both'italictruebrenddraw_map.hidden_trends.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Resposta Subonsciente'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.subconscious_response_explanationdocolor'000000'size18align'both'italictruebrenddocx.pdraw_map.subconscious_response.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.subconscious_response.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Ciclos de Vida'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.life_cycles_explanationdocolor'000000'size18align'both'italictruebrenddraw_map.first_life_cycle.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddraw_map.second_life_cycle.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddraw_map.third_life_cycle.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Desafios'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.challenges_explanationdocolor'000000'size18align'both'italictruebrenddocx.p'Primeiro Desafio'docolor'd11a11'size24boldtruealign'left'brenddraw_map.first_challenge.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Segundo Desafio'docolor'd11a11'size24boldtruealign'left'brenddraw_map.second_challenge.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Desafio Principal'docolor'd11a11'size24boldtruealign'left'brenddraw_map.main_challenge.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Momentos Decisivos'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.decisive_moments_explanationdocolor'000000'size18align'both'italictrueenddocx.pdotext''brenddocx.p'Primeiro Momento Decisivo'docolor'd11a11'size24boldtruealign'left'brenddraw_map.first_decisive_moment.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Segundo Momento Decisivo'docolor'd11a11'size24boldtruealign'left'brenddraw_map.second_decisive_moment.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Terceiro Momento Decisivo'docolor'd11a11'size24boldtruealign'left'brenddraw_map.third_decisive_moment.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Quarto Momento Decisivo'docolor'd11a11'size24boldtruealign'left'brenddraw_map.fourth_decisive_moment.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Número Psíquico'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.psychic_number_explanationdocolor'000000'size18align'both'italictruebrenddocx.pdraw_map.psychic_number.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.psychic_number.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Ano Pessoal'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.personal_year_explanationdocolor'000000'size18align'both'italictruebrenddraw_map.personal_years.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Mês Pessoal'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.personal_months_explanationdocolor'000000'size18align'both'italictrueenddraw_map.personal_months.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pdotext''brenddocx.p'Dia Pessoal'docolor'd11a11'size24boldtruealign'left'brenddraw_map.personal_days_explanation.split("\n")do |line|
docx.plinedocolor'000000'size18italictrueendenddocx.pdotext''brenddocx.p'Dias do Mês Favoráveis'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.favorable_months_explanationdocolor'000000'size18align'both'italictruebrenddraw_map.favorable_months.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endenddocx.pagedocx.p'Números Harmônicos'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.harmonic_numbers_explanationdocolor'000000'size18align'both'italictruebrenddraw_map.harmonic_numbers.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pdotext''brenddocx.p'Harmonia Conjugal'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.marital_harmony_explanationdocolor'000000'size18align'both'italictruebrenddraw_map.marital_harmony.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pagedocx.p'Triângulo da Vida'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.life_triangle_explanationdocolor'000000'size18align'both'italictrueenddocx.pdotext''brenddraw_map.life_triangle.split("\n").eachdo |line|
docx.plinedocolor'000000'size20align'both'endenddocx.pagedocx.p'Conclusão'docolor'd11a11'size24boldtruealign'left'brenddraw_map.conclusion.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pagedocx.p'Significado dos Arcanos'docolor'd11a11'size24boldtruealign'left'brenddocx.pdraw_map.arcanes_meaning.split("\n")[0]docolor'000000'boldtruesize22brenddraw_map.arcanes_meaning.split("\n")[1..-1].eachdo |line|
docx.plinedocolor'000000'size18align'left'endenddocx.pagedocx.p'Numerologia Cabalística'docolor'd11a11'size24boldtruealign'left'brenddraw_map.cabalistic_numerology.split("\n").eachdo |line|
docx.plinedocolor'000000'size18align'both'endendendendend
The text was updated successfully, but these errors were encountered:
I'm not much of a maintainer anymore—and truthfully should cede the project to someone else—but I believe the issue you're having stems from using the save method. This will try to write the output to the file system, which you would not have in Heroku.
I'm working from deep memory here, but I think Caracal::Document has a render function that will return the document as a string, which you can handle however you like.
And, finally, if this is a Rails app, there is a separate gem that was designed to pipe out the document from a controller. I honestly don't know if that still functions, but it might. At the very least, it would point you in the right direction. The plugin itself was just a tiny wrapper. :)
Dear Mr. John Dugan. I am not able to generate documents on production environment on Heroku. I've created a helper that is called from a view and generate my document. On development environment, in my local
puma
server, all works fine, but after I've deployed my app on Heroku and tryed to save the document nothing happens! Thank you for your time!!!The text was updated successfully, but these errors were encountered: