我刚刚在 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: url("app_photo.png");
为 时background: image-url("app_photo.png");
,这里是预编译的 css:
.app_photo{background:url(/assets/app_photo-f095c78ecb698e651f262b36a593dc8e.png);height:64px;width:64px;text-indent:-9999px}