1

I have a Rails 3.2 application, and in it I have a Javascript file (app.'s) which appears to be 'stuck' at a particular, past, version. I've updated the file many times, changing its contents significantly, and being sure each time to Save the file - to no effect. I've rebooted the machine multiple times (thinking at least THAT should clear out the cobwebs) all to no avail. I'm at my wits end trying to think of ways to un-stick this.

I can see that the file is being served, each time I visit the page:

Started GET "/dev-assets/app.js?body=1" for 172.16.0.12 at 2014-04-24 16:49:36 -0700 Served asset /app.js - 200 OK (1ms)

And then later in the same test run (not modified - as I expect):

Started GET "/dev-assets/app.js?body=1" for 172.16.0.10 at 2014-04-24 16:51:31 -0700 Served asset /app.js - 304 Not Modified (0ms)

But STILL it has the old contents (which, have a call to 'location.assign' which has since been removed - so the behavior should be significantly different than what I'm seeing.

I have these settings in my development.rb file (but this is not the complete file):

config.cache_classes = false

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

# Show full error reports and disable caching
config.consider_all_requests_local       = true
config.action_controller.perform_caching = false

# From Rails issue 10091 - attemp to keep from loading scripts
# multiple times
config.assets.prefix = "/dev-assets"

# Do not compress assets
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = true

# Workaround documented in Rails issue 4145
config.serve_static_assets = false

Anyone have any idea how I can clear this old file?

Note - this is very similar to:

Clear the cache from the Rails asset pipeline

But none of those suggestions have helped me.

Community
  • 1
  • 1
user3750746
  • 136
  • 1
  • 6
  • Did you run assets:precompile? It generates static assets under /public/dev-assets directory. You need to remove /public/dev-assets to generate js dynamically. – kengo Apr 25 '14 at 01:28
  • Yes, I do (for Staging & Production). And I always run rake assets:clean first. In fact, when this started, I just ran rake assets:clean to eliminate as a possibility in Development. – user3750746 Apr 25 '14 at 02:41
  • Did you check if /public/dev-assets directory in development environment is really empty? – kengo Apr 25 '14 at 07:14
  • Yes, there is no public/assets nor public/dev-assets directory present. – user3750746 Apr 25 '14 at 18:42

1 Answers1

0

This isn't a Rails problem. Rails is serving up the correct file, as verified by by fetching the file in the browser:

http://localhost:3000/dev-assets/app.js
user3750746
  • 136
  • 1
  • 6