【发布时间】:2013-07-08 18:33:48
【问题描述】:
我刚刚在 Heroku 上推送了我的第一个应用程序,但我的精灵图像似乎尚未上传到服务器。您对可能发生的事情有任何线索吗?
例如: 我的文件是 app/assets/images/app_photo.png
我的 CSS 文件定义我的精灵:background: url("app_photo.png");
在我的应用中,我找到了我的精灵的链接,但是当我点击它时,herokuapp.com/assets/app_photo.png 路径呈现“您要查找的页面没有”不存在”。
这是我推送到 heroku 的日志:
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Detected manifest file, assuming assets were compiled locally
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size: 37.9MB
-----> Launching... done, v17
当我用background: image-url("app_photo.png"); 替换background: url("app_photo.png"); 时,这里是预编译的css:
.app_photo{background:url(/assets/app_photo-f095c78ecb698e651f262b36a593dc8e.png);height:64px;width:64px;text-indent:-9999px}
【问题讨论】:
-
在将应用推送到 Heroku 时是否出现预编译错误?
-
你是否将 /assets 文件夹添加到 git 中?
-
是的,我都做了that!
标签: ruby-on-rails heroku