Rails dev environment not updating html/css/assets even after restarting server

I just want to add something that can make the accepted answer a little bit easier to do. Here's what I use:

rake tmp:cache:clear
rails server

Delete the contents of your public/assets/ directory. That's where precompiled files go, and they're served if they exist, rather than the request falling through to Sprockets. You can safely just nuke the whole directory, and things should work again.


Probably obvious to everyone, but just wanted to add that if deleting or renaming public/assets/ folder, you'll probably also need to restart your local server and clear browser cache :-)


Another technique is to rename the public/assets/ directory to something like public/assets_hide/. Then rename it back before running "rake assets:precompile" and pushing to the server. This cuts down on the precompile time and also preserves the asset file permissions for some gems, like rich, which copies over assets.

An easier way is to modify your config/environments/development.rb file to:

config.serve_static_assets = false

Then you won't need to mess with the public/assets directory. However, if you are using something like paperclip to upload image files, this won't work because the image files won't be served.