3

Rails 3.2.3 アプリが一貫して JS ファイルをロードしていません。私はJSの作業を始めたばかりなので、これが始まったばかりなのか、それとも数日前に始めてからこのようになっているのかはわかりません.

このプロジェクトに取り組んでいる他の 2 人は、まったく問題を抱えていません。しかし、すべてのファイルをロードすることもあれば、一部をスキップすることもあり、パターンがないようです。

app.js をロードする場合とロードしない場合があります。他のjsファイルも同様です。

Rails ログに次のメッセージが複数回表示されます。

ERROR 不正なリクエスト ライン `'。

私はここで途方に暮れています...

アプリケーション.js:

//= require jquery
//= require jquery_ujs
//= require util
//= require app
//= require_tree .

ログファイルの内容は次のとおりです。

Started GET "/assets/user_manager.js?body=1" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /user_manager.js - 200 OK (0ms)


Started GET "/assets/util.js?body=1" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /util.js - 200 OK (0ms)
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
[2012-11-07 18:02:13] ERROR bad Request-Line `'.


Started GET "/assets/header/topnav/separator.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /header/topnav/separator.png - 200 OK (0ms)


Started GET "/assets/header/pagetitle-bg.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /header/pagetitle-bg.png - 200 OK (0ms)
[2012-11-07 18:02:13] ERROR bad Request-Line `'.


Started GET "/assets/header_bg.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /header_bg.png - 404 Not Found (3ms)

ActionController::RoutingError (No route matches [GET] "/assets/header_bg.png"):
  actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.3) lib/rails/engine.rb:479:in `call'
  railties (3.2.3) lib/rails/application.rb:220:in `call'
  rack (1.4.1) lib/rack/c[2012-11-07 18:02:13] ERROR bad Request-Line `'.
ontent_length.rb:14:in `call'
  railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
  rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
  /Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/server.rb:191:in `block in     start_thread'


  Rendered /Users/rob/.rvm/gems/ruby-1.9.3-p125@admin/gems/actionpack-3.2.    3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)


Started GET "/assets/background/header_blueprint.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /background/header_blueprint.png - 200 OK (0ms)


Started GET "/assets/images/ui-icons_454545_256x240.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /images/ui-icons_454545_256x240.png - 404 Not Found (3ms)

ActionController::RoutingError (No route matches [GET] "/assets/images/ui-icons_454545_256x240.png"):
  actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.3) lib/rails/engine.rb:479:in `call'
  railties (3.2.3) lib/rails/application.rb:220:in `call'
  rack (1.4.1) lib/rack/content_length.rb:14:in `call'
  railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
  rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
  /Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/server.rb:191:in `block in     start_thread'


  Rendered /Users/rob/.rvm/gems/ruby-1.9.3-p125@admin/gems/actionpack-3.2.    3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.8ms)
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
[2012-11-07 18:02:13] ERROR bad Request-Line `'.    
4

1 に答える 1

2

JS ファイルと CSS ファイルがランダムに Google Chrome に読み込まれないという同じ問題がありました。このエラーがログに表示されます。

ERROR bad Request-Line `'.

Cookie を削除しても問題は解決しませんでしたが、問題は Cookie に関連していたに違いありません。キーインの名前を変更し、問題が解決したらconfig/initializers/session_store.rb名前を元に戻すことで問題を解決しました。変。

于 2013-03-08T15:20:13.963 に答える