Tom*_*ats 9 ruby-on-rails asset-pipeline ruby-on-rails-4
基本上我的问题是页面加载正常并且看起来很正常.大约30秒后,它突然消失了.
这是错误之前的服务器日志(加载页面时):
Started GET "/" for 127.0.0.1 at 2014-03-11 23:53:30 -0400
Processing by PagesController#home as HTML
Rendered pages/home.html.erb within layouts/application (0.7ms)
Rendered layouts/_head.erb (3.3ms)
Rendered layouts/_header.erb (0.9ms)
Rendered layouts/_footer.erb (0.2ms)
Completed 200 OK in 11ms (Views: 10.5ms)
Started GET "/assets/favicon.ico" for 127.0.0.1 at 2014-03-11 23:53:30 -0400
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-03-11 23:53:30 -0400
Started GET "/assets/home.css?body=1" for 127.0.0.1 at 2014-03-11 23:53:30 -0400
Started GET "/assets/taylor.jpg" for 127.0.0.1 at 2014-03-11 23:53:30 -0400
Started GET "/assets/wide.jpg" for 127.0.0.1 at 2014-03-11 23:53:30 -0400
Started GET "/assets/enchanted_large.png" for 127.0.0.1 at 2014-03-11 23:53:30 -0400
Started GET "/assets/sad.jpg" for 127.0.0.1 at 2014-03-11 23:53:30 -0400
Run Code Online (Sandbox Code Playgroud)
然后突然图像因客户端错误而消失(在Chrome的开发控制台中看到):
Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
http://localhost:3000/assets/taylor.jpg
Run Code Online (Sandbox Code Playgroud)
而日志的唯一补充是:
Started GET "/assets/favicon.ico" for 127.0.0.1 at 2014-03-11 23:54:00 -0400
Run Code Online (Sandbox Code Playgroud)
在它看起来很好的30秒内,镀铬有一个装载符号,其中有图标
我的HTML在这一点上相当简单:
<div class="home-images">
<%= image_tag "taylor.jpg", class: "home-image" %>
<%= image_tag "wide.jpg", class: "home-image hide" %>
<%= image_tag "sad.jpg", class: "home-image hide" %>
</div>
Run Code Online (Sandbox Code Playgroud)
我甚至完全拿出了我的javascript.我也尝试自己去掉turbolinks.它只发生在一个图像上.我不知道为什么......
当我切换html时,它是同一个图像(泰勒)给出了错误:
<div class="home-images">
<%= image_tag "wide.jpg", class: "home-image" %>
<%= image_tag "taylor.jpg", class: "home-image hide" %>
<%= image_tag "sad.jpg", class: "home-image hide" %>
</div>
Run Code Online (Sandbox Code Playgroud)
我的所有图片都位于我的app/assets/images文件夹中
我的标题看起来像这样:
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Enchanting Events and Design</title>
<%= favicon_link_tag "favicon.ico" %>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7914 次 |
| 最近记录: |