嘿,我在我的 Rails 应用程序(Heroku,生产,Rails 3.2.3)中遇到了这个错误:
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'
它在生产中更改为延迟加载后开始发生,我需要:
应用程序.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 上得到一个错误