user1807681
user1807681

Reputation: 31

Rails isn't loading my JS properly - ERROR bad Request-Line `'

I have a Rails 3.2.3 app isn't consistently loading JS files. I just started working on the JS, so I'm not sure if this just started, or if it's been this way since I started it a few days ago.

The two other guys working on the project are not having any problems at all. But sometimes it loads all of my files, sometimes it skips some, there doesn't seem to be any pattern.

Sometimes it loads app.js, sometimes it doesn't. Same thing with the other js files.

I'm seeing the following show up multiple times in my rails log:

ERROR bad Request-Line `'.

I'm at a loss here...

application.js:

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

Here is what the log file is showing:

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 `'.    

Upvotes: 3

Views: 485

Answers (1)

Arctodus
Arctodus

Reputation: 5847

I had the same problem with JS and CSS files randomly failing to load in Google Chrome, this error showing in the logs:

ERROR bad Request-Line `'.

The problem must have been cookie related, though deleting the cookie did not work for me. I solved the problem by renaming they key in config/initializers/session_store.rb and then renaming it back once the problem was gone. Strange.

Upvotes: 2

Related Questions