【发布时间】:2012-07-20 04:53:25
【问题描述】:
我在 /app/assets/images 文件夹中添加了一张图片,logo-small.jpg
然后我将这一行添加到我的视图中
= link_to image_tag('logo-small.jpg'), root_path, :class => 'brand'
然后我预编译,
rake assets:precompile RAILS_ENV=production
git add、git commit 和 git push heroku master。推送有效。
我仍然收到错误
ActionView::Template::Error (logo-small.jpg isn't precompiled):
为什么?
编辑:我尝试了其他图像,它们都很好。 Heroku 的 logo 和 logo-small 有问题,但其他图像没有。 wtf??
【问题讨论】:
-
你在 heroku 上运行什么堆栈?新的 Cedar 堆栈应该会自动预编译您的资产。如果它较旧,您可能必须在服务器上运行 rake 任务。
-
雪松。我在 2 天前开设了帐户。
-
谢谢。你能像下面这样在你的服务器上手动运行
assets:precompile吗?
标签: ruby-on-rails heroku production-environment precompiled