Rails4链轮; 资产逻辑路径没有扩展名
我最近升级到Rails 4,在运行我的请求规范时,我开始收到以下错误:
失败/错误:无法从回溯中找到匹配的行Sprockets :: ArgumentError:资产逻辑路径没有扩展名:europe
Blockquote#
initialize' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/base.rb:380:in
new’#initialize' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/base.rb:380:in
-2.10.1 / lib / sprockets / base.rb:380:在build_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in
/ usr / local / rvm / gems / ruby-1.9.3-p448 / gems / swsockets-2.10.1 / lib / sprockets / index中build_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in
build_assetbuild_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in
块’#/cache_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in
local /cache_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in
gems /cache_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in
gems /cache_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in
lib /cache_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in
cache.rbbuild_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in
58build_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in
cache_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in
build_asset’#/cache_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in
.3-p448 / gems / sprockets-2.10.1 / lib / sprockets / base.rb:287:infind_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:61:in
/ usr / local / rvm / gems /ruby-1.9.3-p448 / gems / swsockets-2.10find_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:61:in
find_asset’#find_asset' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:61:in
47 :在call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:71:in
call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:71:in
在调用块中## /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb :59:在each' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in
‘#/ usr /each' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in
/ rvm / gems /each' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in
/ gems /each' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in
/ lib / action_dispatch / travel /each' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in
:each' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in
:59:each' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in
call’#/ usr /local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:680:incall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/etag.rb:23:in
call’#/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/etag.rb:23:in
.2 / lib / rack / conditionalget.rb:25:在call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/head.rb:11:in
/ rvm / gems / ruby-1.9.3-p448 / gems / rack-1.5.2 / lib / rack /call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/head.rb:11:in
电话’call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in
rvmcall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in
ruby-1.9.3-p448call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in
remotipartcall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in
libcall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in
middleware.rbcall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/head.rb:11:in
电话’call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in
call’#call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in
-p448 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / flash.rb:241:incall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in
/ usr / local / rvm / gems / ruby-1.9.3call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in
上下文’#/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in
1.5.2 / lib / rack / session / abstract / id.rb:220:在call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/ usr / local / rvm / gems / ruby-1.9.3-p448 / gems / action-4.0.2 / lib / action_dispatchcall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
调用’#/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/ local /call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in
call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
/ usr/local/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
/gems/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
/gems/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
-4.0.2/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
/active_record/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
/abstract/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
call’#/ usr / local / rvm / gems / ruby-1.9.3-p448 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / callbacks.rb:29:inblock in call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:373:in
/ usr / local / rvm / gems / ruby-1.9block in call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:373:in
run _515869138317914613_ call _callbacks’#/block in call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:373:in
-4.0.2 / lib / active_support / callbacks.rb:80:inrun_callbacks' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/callbacks.rb:27:in
usr / local / rvm / gems /ruby-1.9.3-p448 / gems / actionpack4.0.2 / lib / action_dispatch /run_callbacks' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/callbacks.rb:27:in
run_callbacks' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/callbacks.rb:27:in
调用’#/run_callbacks' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/callbacks.rb:27:in
call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/debug_exceptions.rb:17:in
/ usr / local / rvm / gems / ruby-1.9.3-p448 / gems / action-4.0.2 / lib / action_dispatch / middleware / debug_exceptions.rb:17:call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/debug_exceptions.rb:17:in
call’#/ usr / local / rvm /gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/show_exceptions.rb:30:incall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in
usrcall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in
rvmcall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in
gemscall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in
ruby-1.9.3-call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in
call_app’#/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in
/lib/rails/rack/logger.rb:20:inblock in call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
usrblock in call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
rvm / gems / ruby-1.9.3-p448 / gems / activesupport-4.0.2 / lib / active_support / tagged_loggingblock in call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
标记为’#/ usrtagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
localtagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
rvmtagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
gemstagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
ruby-1.9.3-p448tagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
gemstagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
activesupport-4.0.2tagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
libtagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
active_supporttagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
block in call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
tagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
标记为’#/tagged' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in
0.3-P448 /gem/ railties- 4.0.2 / lib / rails / rack / logger.rb:20:incall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/ usr / local / rvm / gems / ruby-1.9.3-p448 / gems / action-4.0.2 / lib / action_dispatch / middlewarecall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
打电话’#/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/ local /call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in
‘call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/runtime.rb:17:in
调用’#/ usr / local / rvm / gems / ruby- 1.9.3-p448 / gems / activesupport-4.0.2 / lib / active_support / cache / strategy / local_cache.rb:83:incall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
usr / local / rvm / gems / ruby-1.9.3-p448 / gemscall' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
call’#/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
/ local /call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in
/ rack / sendfile.rb:112:在call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/engine.rb:511:in
/ rvm / gems / ruby-1.9.3-p448 / gems / raidies-4.0.2 / lib / rails / engine.rb:511:来电’ #call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:138:in
调用’#/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:138:in
1.5.2 / LIB /齿条/ urlmap.rb:65:在block in call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in
usr / local / rvm / gems / ruby-1.9.3-p448 / gems / rack-1.5.2 / lib / rack / urlmap.rb:50:in each’ #call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/capybara-2.2.0/lib/capybara/server.rb:19:in
call’#/call' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/capybara-2.2.0/lib/capybara/server.rb:19:in
1.5.2 / lib / rack / handler / webrick.rb:60:inservice' # /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rbservice' # /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in
服务’run' # /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in
service' # /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in
‘run' # /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in
块’
有没有办法让Sprockets接受没有扩展名的文件?
Gems:链轮:2.10.1 Rails:4.0.2
在你的config / application.rb文件中添加
initializer 'setup_asset_pipeline', :group => :all do |app| # We don't want the default of everything that isn't js or css, because it pulls too many things in app.config.assets.precompile.shift # Explicitly register the extensions we are interested in compiling app.config.assets.precompile.push(Proc.new do |path| File.extname(path).in? [ '.html', '.erb', '.haml', # Templates '.png', '.gif', '.jpg', '.jpeg', # Images '.eot', '.otf', '.svc', '.woff', '.ttf', # Fonts ] end) end
所以它看起来像
module ProjectName class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de initializer 'setup_asset_pipeline', :group => :all do |app| # We don't want the default of everything that isn't js or css, because it pulls too many things in app.config.assets.precompile.shift # Explicitly register the extensions we are interested in compiling app.config.assets.precompile.push(Proc.new do |path| File.extname(path).in? [ '.html', '.erb', '.haml', # Templates '.png', '.gif', '.jpg', '.jpeg', # Images '.eot', '.otf', '.svc', '.woff', '.ttf', # Fonts ] end) end end end
为了预编译资产,您需要将没有扩展名的任何文件从app / assets移动到供应商/资产中。 这是一个已知的问题,链轮和凉亭在他们的自述文件中有关于它的警告,请参阅https://github.com/stve/bower/pull/4/files
或者您可以确保app / assets中的所有文件都有扩展名,但这更耗时。