问题描述
标准的新 rails 应用程序在显示 rails.png 时出现问题
Standard new rails app has issue showing the rails.png
ActionController::RoutingError (No route matches [GET] "/assets/rails.png"):
我尝试将 .png 文件移动到资产和资产/图像中的各个位置,以及较旧的公共"或公共/图像"位置并更改页面,但没有任何帮助.如果您已经看到并解决了这个问题,请回答.我自己尝试了大约 20 种不同的组合.
I have tried moving the .png file around to various places in assets and assets/images and also the older place 'public' or 'public/images' and changing the page but nothing has helped. Please answer if you have seen and resolved this. I have tried about 20 different combo's myself.
版本:'导轨','3.1.0.rc4'
Version:'rails', '3.1.0.rc4'
推荐答案
这一定是 rc4 的问题,因为最终版本没有这个问题.
It must have been an rc4 issue as the final release didn't have this issue.
11/27/11 - 我现在想知道这是否只是由于在 rails 3.1 中引入的资产管道,需要 rake assets:precompile
command(编译和复制图像、css 和 js 从 app/assets
到 public/
.
如果有人认为是这种情况,请添加评论!
这篇关于rails 3.1 ActionController::RoutingError(没有路由匹配[GET]“/assets/rails.png"):的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!