我試圖在解決我的鏈接:問題的鏈接,獲取消息「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) –