我正在使用带有 sinatra 的链轮。
require 'sprockets'
set :assets, Sprockets::Environment.new
# Configure sprockets
settings.assets.append_path "assets/js"
settings.assets.append_path "assets/js/libs"
settings.assets.append_path "assets/css"
get "/js/:file.js" do
content_type "application/javascript"
settings.assets["#{params[:file]}.js"]
end
get "/js/libs/:file.js" do
content_type "application/javascript"
settings.assets["libs/#{params[:file]}.js"]
end
get "/css/:file.css" do
content_type "text/css"
settings.assets["#{params[:file]}.css"]
end
我仅使用此 javascript 文件收到此错误。不知道我能做些什么,我的 app.rb 中有编码:utf-8。
174.31.173.110 - - [16/Dec/2012 17:08:53] "GET /js/libs/modernizr-2.0.6.js HTTP/1.0" 200 - 0.0017
E, [2012-12-16T17:08:53.568260 #12145] ERROR -- : app error: /var/www/myapp/releases/20121217010420/assets/js/libs/modernizr-2
.0.6.js has a invalid US-ASCII byte sequence (Sprockets::EncodingError)