在Heroku上调试rails-latex gem |ActionView :: Template :: Error rails-latex失败 [英] Debugging rails-latex gem on Heroku | ActionView::Template::Error rails-latex failed

查看:52
本文介绍了在Heroku上调试rails-latex gem |ActionView :: Template :: Error rails-latex失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

我有一个Rails应用,它通过 rails-latex gem生成pdf.它在 rails s heroku local 上可以正常工作.但是,尝试在Heroku上使用pdf-generation-link会使我很抱歉,但是出了点问题.

I have a Rails app which generates a pdf via the rails-latex gem. It works just fine on rails s and heroku local. However, trying to use the pdf-generation-link on Heroku throws me We're sorry, but something went wrong.

使用 heroku日志--tail 会显示以下内容:

Rendered sheets/show.pdf.erb within layouts/application (3.4ms)
Running 'pdflatex -halt-on-error -shell-escape -interaction=batchmode input' in /app/tmp/rails-latex/4--3678030941334020140 1 times...
Completed 500 Internal Server Error in 59ms (ActiveRecord: 5.6ms)
ActionView::Template::Error (rails-latex failed: See /app/tmp/rails-latex/4--3678030941334020140/input.log for details):
19:
20: \end{document}
app/views/layouts/application.pdf.erbtex:22:in `_app_views_layouts_application_pdf_erbtex___[LOTS OF NUMBERS]

同样,Heroku应用程序的其余部分和本地版本都可以正常工作,因此这对模型等来说不是问题.

Again, the rest of the Heroku app and the local version are working, so this is not a problem with models etc.

teX带有反安装(安装在推入时显示为成功). heroku buildpacks 是:

teX is installed with a buildback (the installation shows as successful when pushing). heroku buildpacks is:

1. heroku/ruby
2. https://github.com/Thermondo/heroku-buildpack-tex.git

我尝试过的事情:

我试图访问错误消息中引用的文件,但是(由于Herokus dyno系统,我认为) app/tmp 不存在或 heroku无法访问至少运行bash 控制台.

I tried to access the file referenced in the error message, however (I think because of Herokus dyno system) the app/tmp does not exist or isn't accessible by the heroku run bash console at least.

日志中引用的布局文件包含:

The layout file referenced in the logs contains:

\documentclass[12pt,a5paper,sloppy]{article}
<% @latex_config = { :recipe => [
	{:command => 'pdflatex'},
]} # you can override the defaults if you wish; see LatexToPdf#config
%>
\usepackage{filecontents}
\usepackage{lastpage}
\usepackage{graphics}
\usepackage[utf8]{inputenc}
\usepackage{scrextend}
\usepackage[a5paper, left=.3cm, right=.3cm, bottom=0cm, top=0.3cm]{geometry}

\setlength\parindent{0pt}
\thispagestyle{empty}

\begin{document}

	<%= yield %>

\end{document}

结论:

我在这里真的很茫然,因为我无法获得更多信息来调试或将错误复制到其他任何地方.

I'm really at a loss here because I can't get more information to debug nor replicate the error anywhere else.

推荐答案

以防万一有人偶然发现此问题:

Just in case anyone ever stumbles upon this:

经过一番头痛之后,我发现包含tex软件包(在buildpack的README中指示)的文件的名称不正确,没有执行任何操作,因此我尝试使用不存在的软件包.

After a lot of headache I found that my file containing my tex packages (instructed in the README of the buildpack) was incorrectly named and not doing anything, so I was trying to use non-existing packages.

修复使我陷入了texlive-versions世界的另一个困境,但通过各种版本声明和替换库的方式强行逼我,终于使我可以使用Heroku应用了.

Fixing that sent me down another rabbithole in the world of texlive-versions, but brute-forcing my way through various version declaration and replacing libraries finally got me a working Heroku app.

如果您遇到类似的问题,建议删除所有tex依赖项,获取MWE,然后慢慢将其重新添加以识别邪恶的人.

If you have a similar problem, I recommend deleting all tex dependencies, get a MWE and then slowly add them back in to identify the evildoers.

这篇关于在Heroku上调试rails-latex gem |ActionView :: Template :: Error rails-latex失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆