kidcapital
kidcapital

Reputation: 5174

Rails 3.1 not detecting Coffeescript and Javascript changes?

Sometimes I update my Coffee code in Rails 3.1 and it doesn't detect any of the changes, ie. I refresh my browser/cache and it still invokes the old script. Anyone know what causes this?

EDIT: I even litter my entire scripts with "debugger" and none of them ever gets called. Any idea why it simply won't refresh the Coffeescripts?

EDIT2: I realize that it doesn't even detect javascript changes sometimes. Am I missing something? Note I am not bouncing my server when I change JS files... It used to work...

Upvotes: 5

Views: 3783

Answers (3)

songz
songz

Reputation: 2092

Try rake assets:precompile, if you haven't already.

Upvotes: 0

kidcapital
kidcapital

Reputation: 5174

For the curious, it suddenly started functioning correctly again by itself. I have reason to believe it was actually the Daylight Savings Time that caused this bug. Not sure if this could be the case but it suspiciously started working again naturally after a fixed amount of time (about 1 hour).

Upvotes: 2

Ion Br.
Ion Br.

Reputation: 2648

For the development environment you could try to rake assets:clean. Rails sometimes reads the precompiled assets in development environment, so this will clean them and the fresh ones will be loaded.

For the production environment try to rake assets:precompile, so that the changes are compiled and stored in the assets files.

Upvotes: 6

Related Questions