Topic: [resolved] Asset precompile - please tell me I haven't broken my app

This is making me feel sick, I hope someone can help.

Earlier today I made some style changes, including adding a new css file to my assets/stylesheets directory. I pushed the changes to Heroku, but got 500 server error and the log indicated that my new css file was not compiled. After doing some research, I thought that I needed to precompile my assets so I ran this:

bundle exec rake assets:precompile

then did git commit and pushed to heroku again. I didn't fix the problem, so after more research I tried making a change to my production.rb file, commit and push and everything is back to working on heroku again.

BUT, now my local development version is having some weird problems. It looks to be related to javascript assets. I'm not seeing any errors in my log files, but one of my drop-down menus isn't working, and my datatables are giving me an error.

Now I'm thinking it's because I failed to add an ENV = production on to the end of the rake assets:precompile that I did earlier. Looking in my public file, I can see a full assets directory in there.

Also, switching to older git branches doesn't fix the problem.

So is there a way to undo the rake assets? That's the only thing I can think of that's causing the problem.

Please tell me I can fix this!

By the way, I'm using Rails 3.2 and Ruby 1.9.


Update: I tried

$ rake assets:clean

but still having the same probems...

Last edited by Brian71 (2012-05-01 23:40:12)

Re: [resolved] Asset precompile - please tell me I haven't broken my app

Okay, I'm going to mark this resolved for now. After doing the rake assets:clean, the problem continued, but after much head-banging, and nothing making sense, I decided on a whim to try clearing my browser's cache on a hunch that errors were being created by some double-loading due to the assets being moved around.

Sure enough - after the browser cache was cleared, the problems vanished! Yay! I can sleep tonight. smile

Re: [resolved] Asset precompile - please tell me I haven't broken my app

Hey that was really helpful and i would like you to visit www(dot)ebizsitedesigns(dot)com(dot)au