the rails present not images asset ruby ruby-on-rails-4 sprockets

ruby - present - Ruedas dentadas Rails4; La ruta lógica del activo no tiene extensión



sprockets rails (2)

Recientemente me actualicé a Rails 4 y, mientras ejecutaba las especificaciones de mi solicitud, empecé a recibir el siguiente error:

Error / Error: No se puede encontrar la línea coincidente desde el camino de retroceso Sprockets :: ArgumentError: La ruta lógica del activo no tiene extensión: europa

Blockquote # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/asset.rb:36:in initialize'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/base.rb:380:in nuevo ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets -2.10.1 / lib / sprockets / base.rb: 380: en build_asset'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in bloque en build_asset ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/caching.rb:58: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 ''# /usr/local/rvm/gems/ruby-1.9 .3-p448 / gems / sprockets-2.10.1 / lib / sprockets / base.rb: 287: in find_asset'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/index.rb:61:in find_asset ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.10.1/lib/sprockets/server.rb:47 : en 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 bloque en call ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb : 59: en 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:in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/etag.rb:23:in call ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5 .2 / lib / rack / conditionalget.rb: 25: in 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/remotipart-1.2.1/lib/remotipart/middleware.rb:27: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 ''# /usr/local/rvm/gems/ruby-1.9.3 -p448 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / flash.rb: 241: en call'' # /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 context ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack- 1.5.2 / lib / rack / session / abstract / id.rb: 220: 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/query_cache.rb:36: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 call'' # / usr / local / rvm / gems / ruby-1.9.3-p448 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / callbacks.rb: 29: en block in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:373:in ejecución _515869138317914613_ call _callbacks ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport -4.0.2 / lib / active_support / callbacks.rb: 80: 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/remote_ip.rb:76: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 call'' # / usr / local / rvm /gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/show_exceptions.rb:30:in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in call_app ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2 /lib/rails/rack/logger.rb:20: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 bloque en etiquetado ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:25: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 / railties- 4.0.2 / lib / rails / rack / logger.rb: 20: 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/methodoverride.rb:21:in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/runtime.rb:17:in call ''# / usr / local / rvm / gems / ruby- 1.9.3-p448 / gems / activesupport-4.0.2 / lib / active_support / cache / strategy / local_cache.rb: 83: in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in usus/local/rvm/gems/ruby-1.9.3-p448/gems 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/rack-1.5.2/lib/ rack / sendfile.rb: 112: in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/engine.rb:511:in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.2/lib/rails/application.rb:97:in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:138:in llamada ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack- 1.5.2 / lib / rack / urlmap.rb: 65: en block in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in each'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in call'' # /usr/local/rvm/gems/ruby-1.9.3-p448/gems/capybara-2.2.0/lib/capybara/server.rb:19:in llamada ''# /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack- 1.5.2 / lib / rack / handler / webrick.rb: 60: en service'' # /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in servicio ''# /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in run'' # /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in block in start_thread ''

¿Hay alguna manera de hacer que Sprockets acepte archivos sin una extensión?

Gemas: Piñones: 2.10.1 Rieles: 4.0.2


Para precompilar los activos, debe mover los archivos sin extensiones de la aplicación / los activos al proveedor / activos. Este es un problema conocido con las ruedas dentadas y Bower tiene una advertencia al respecto en su archivo Léame, consulte https://github.com/stve/bower/pull/4/files

O puede asegurarse de que todos los archivos en la aplicación / activos tengan una extensión, pero eso requiere más tiempo.


en su archivo config / application.rb agregue

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

por lo que parece

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