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...
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.
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).
Try rake assets:precompile, if you haven't already.
Related
I'm uncertain if this is an issue with Brunch or elm-brunch or some configuration detail I've screwed up. Frequently, when I change an Elm file in my project, the compilation will appear to run, but the result will show elm compiler errors that were fixed on the last save. The errors disappear if I quit and rerun the watch command. I'm not sure why this is happening or even how to narrow down the possibilities.
For setup details, I'm running it using brunch-with-elm-and-electron as boilerplate. My brunch version is 2.9.1.
Your configuration is ok. This is both brunch and elm-brunch issue. Brunch plugins are designed to compile each file separately on change. elm-brunch, however, runs elm-make for elm modules instead. That's why brunch cache is not being updated properly, causing redundant error messages.
Unfortunately, there is no quick fix, but we are looking into the problem. Here's the GitHub issue to track a progress. Thanks a lot, this is a good catch!
UPD: Here's the pull request that should fix the issue.
I'm working on a gem locally, referenced it using bundle config local.GEMNAME (this is confirmed by the printout of bundle install). However, unless I bump the version on the gem, I can't use the most up-to-date code. When errors occur in the old code, it references the file in the right place, where I have fixed the error. I temporarily had bundler-cache-all switched on, but have turned that to false (and deleted .bundle/config).
Where is this cache living (I'm on OSX, using RBenv and ruby 2.1.2), and how can I turn it off?
Have you tried running spring stop and restarting your server (assuming this is a Rails app)?
If it's referencing the file in the right place but executing the wrong code, that indicates that the old code is still loaded into memory. Often, this is because of the Spring pre-loader, which is used by default with Rails 4.1+.
So I'm working with RequireJS and BackboneJS. I can get everything to work fine in Chrome but when I load up in Firefox I'm getting that lessc is not defined. Obviously pulling out the less files will prevent the error from occurring. Does anyone have any ideas why require is unable to load lessc in firefox but its doing fine in chrome?
Screenshot:
http://screencast.com/t/WenocFdCA0V
Video w/ lessc not being defined in Chrome but not Firefox
http://screencast.com/t/ac96qZrpQb3R
Let me know what other info may be useful.
Thanks in advance!
Seth
less.js is broken, because it uses loadStyles before it defines it, and Firefox stopped hoisting functions according to the spec. There are probably more such mistakes, but this is the first one that is triggered during execution. Please note that the minified version is not affected because of the minification rewriting the code.
less-require is similarly broken, as it contains less.js and therefore contains the same bug.
You might want to replace lessc.js in require-less with the 1.5 beta or master version of less.js to work around this, or wait for upstream to officially release it and require-less to pick it up.
However, it appears that lessc.js is a modified version, so it isn't likely as easy as replacing the file. You would need to merge the changes back.
It might be easier just to move the affected latedefs around until it runs correctly instead of upgrading to a later less.js version.
I recently changed an image on the landing page of my herokuapp built in rails. I realized that everything worked fine except that the landing page threw a 500 error. Upon some research I realized i should run RAILS_ENV=production bundle exec rake assets:precompile
After doing so, the images and some of the styling came back but some of it is still screwy and I cannot understand why.
I've read through just about every stackoverflow thread, the rails guide on the asset pipeline, and others but I can't get it to work. I've amended the files that need amending
as far as I know but nothing is working to make the styling revert to how it should be.
However, on the rails guide it notes that there are two caveats to locally precompile:
You must not run the Capistrano deployment task that precompiles
assets. You must change the following two application configuration
settings. In config/environments/development.rb, place the following
line:
config.assets.prefix = "/dev-assets"
I did the change within development.rb but I am not sure on how I can not run Capistrano. I dont think I'm doing that so maybe it's throwing some things off - idk, but each time I try to recompile now, the rake aborts. Any help is very much appreciated.
I seem to be having major issues with the asset pipeline in Rails 3.2. It alls started because I wanted to add a single, simple style to my application.css.scss whilst working in the development environment. I have done this in the past with no problem and it just works because there is no caching occurring (as you would expect).
However, when I attempted to add the new style today, Rails refused to load the updated styles. I checked my environment settings and they all seem correct in development.rb,
config.assets.compress = false
config.assets.debug = true
I did some research and came across rails 3.1 asset pipeline css caching in development. Following the advice given in that question, I made sure that I deleted the tmp/cache folder as well performed a clean using rake assets:clean just in case I had run the app in production mode at some point and it needed cleaning up.
After all this, still no luck. Just to confirm that I hadn't made a bonehead mistake, I temporarily moved the style to another stylesheet. No problems! It worked perfectly! So I moved the style back and it won't load again.
I also checked the console. It reloaded the other stylesheet correctly but no mention of the original stylesheet.
Now, here comes the major issue. As a last ditch effort, I tried clearing my browser cache. I normally have no problems with it on but I thought something might be cached and causing problems. I cleared it and reloaded the app and.... no styles loaded whatsoever!
It seems that all of my application.css.scss styles were cached at some previous point and now I simply can't reload them!
UPDATE:
Although I still haven't fixed the problem, I've worked around it by creating a new stylesheet called main.css.scss (name not important) and moving all of the styles to the new stylesheet. This works because of the //= require_tree . directive in the manifest.
But if anyone can shed some light on why the original stylesheet stopped working, I would love to know!
try rm -r public/assets/*
maybe your assets:clean task is not working properly.