1
嘿我在我的Rails應用程序(Heroku,production,Rails 3.2.3):Heroku Rails 3.2 ActionView :: Template :: Error(...(file)...有一個無效的UTF-8字節序列):
ActionView::Template::Error (/app/vendor/assets/javascripts/star-rating/jquery.MetaData.js has a invalid UTF-8 byte sequence):
3: <head>
4: <title>ContactTool</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
9: <body>
app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__630446545548622900_53107960'
它開始轉變爲延遲加載在生產,這是我需要後發生:
application.rb中
...
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
# Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
Bundler.require(:default, :assets, Rails.env)
end
...
我該如何解決這個問題?謝謝!
更新:
我刪除該文件只是爲了測試是否有錯誤不只是關係到該文件,它是。沒有這個文件,一切正常。我雖然需要這個文件,所以如果有人知道爲什麼我會在UTF8得到一個錯誤
你試過用新副本替換'jquery.MetaData.js'嗎?對我來說,這個錯誤聽起來像是你在那個文件中有一些垃圾字符。 – jmdeldin
我會嘗試。是的,我認爲我可能不錯,但我不記得打開它。 – botbot
nope,那肯定不是問題,更新文件後我得到了同樣的錯誤。仍然可能是一些垃圾字符,但它不是我無意中添加的。必須是別的東西。 – botbot