我试图在解决我的链接:问题的链接,获取消息“ie.css不预编译”
http://92.51.243.6/
不知道为什么他们不工作。我在说的链接是页面顶部的“主页”和“关于”。它在本地WEBrick模式下都可以正常工作。我听说Ajax可能是问题所在,所以我从这些链接中取出:remote => true,并在文件scripts.js中禁用ajax,该文件负责处理我的ajax。
中的链接的代码是:
<div id = "menu">
<ul id = "home_page_links">
<li><%= link_to "Home",about_us_path %></li>
<li><%= link_to "About Us",about_us_path %></li>
</ul>
</div>
在我的routes.rb文件我有:
QuestionnaireSite::Application.routes.draw do
get "home", :to => "static_pages#about_us"
get "about_us", :to => "static_pages#about_us"
的消息我得到的, '很抱歉,但出事了'是我公共文件夹中的错误页面。
当我运行:
tail -f /var/www/apps/myapp/current/log/production.log
我得到:
Started GET "https://stackoverflow.com/users/sign_in" for 87.198.119.247 at Thu May 30 10:52:04 +0100 2013
Processing by Devise::SessionsController#new as HTML
Rendered users/sessions/new.html.erb within layouts/devise (4.4ms)
Rendered layouts/_fb_init.html.erb (0.1ms)
Rendered layouts/_signed_out_header.html.erb (0.7ms)
Rendered layouts/_messages.html.erb (0.1ms)
Completed 200 OK in 10ms (Views: 7.5ms | ActiveRecord: 0.3ms)
Started GET "/about_us" for 87.198.119.247 at Thu May 30 11:02:29 +0100 2013
Processing by StaticPagesController#about_us as HTML
Rendered static_pages/about_us.html.erb within layouts/application (0.0ms)
Completed 500 Internal Server Error in 4ms
ActionView::Template::Error (ie.css isn't precompiled):
12: <%= javascript_include_tag "application" %>
13: <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
14: <!--[if lt IE 9]>
15: <%= stylesheet_link_tag 'ie', :media => 'all' %>
16: <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
17: <![endif]-->
18: </head>
app/views/layouts/application.html.erb:15:in `_app_views_layouts_application_html_erb___1658874457_26880020'
所以我得到一个错误:ie.css不预编译。
根据我的错误信息,我是否需要在第12行至第18行进行更改? 我做:
rake assets:precompile
这似乎已成功完成,因为我得到了:
/home/app/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby /home/app/.rvm/gems/[email protected]/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
我缺少的东西?
您可以在其中传递一个数组config.assets您的配置文件添加以下行.precompile + = ['your.js','your.css'],因为你只有一个css会给你一个问题,所以你可以从清单中添加它。 (ref - http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets) –