当我加载应用程序的每个页面时,我收到此错误。我搜索了SO和网络无济于事。知道如何修复此错误吗?
Started GET "/javascripts/jquery.js" for 127.0.0.1 at 2013-11-20 16:26:14 -0500
ActionController::RoutingError (No route matches [GET] "/javascripts/jquery.js"):
actionpack (3.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.0) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.0) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.0) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.0) lib/rails/engine.rb:479:in `call'
railties (3.2.0) lib/rails/application.rb:220:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.0) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
/Users/DylanRichards/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/DylanRichards/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/DylanRichards/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Rendered /Users/DylanRichards/.rvm/gems/ruby-1.9.2-p320@rails3tutorial/gems/actionpack-3.2.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.7ms)
答案 0 :(得分:0)
您是否在require
文件中添加了application.js
个语句? (在JS函数添加这些之前)
//= require jquery
//= require jquery_ujs
答案 1 :(得分:0)
问题是我的JavaScripts不在资产管道中,而是公共文件夹。