Assets Pipeline for Rails 4

About 3 weeks ago, my friends and I joined the DC Startup Weekend hackathon. It's been my 2nd or 3rd time at Startup weekend. Truth be told, I'm kind of jaded about hackathons. Mostly, people who go and create an actual product over the weekend almost never win. It's always people who show up and run through a slide show.

So I got a little bummed when my friends and I set out again to create a product over the weekend. But who cares! I love hanging out with these silly d00ds! Turns out we actually won crowd favorite and got an honorable mention from the judges!

I know right, this is the third paragraph and I haven't teased you with a link or an image yet!? GET BRAG! Boom! Awwww wutttt? Yeah that's the website we built. It's a javascript snippet you drop onto your website to pull all your favorited tweets for your business as testimonials.

So we were trying to decide on which version of Ruby, Rails and Capistrano to use. And to be honest, I've been wanting to go 2.0/4.0/3.0 I've been reading up all about the lazy sweep bitmap GC and I wanted to see it in action. Haaahhh... speaking of which, I'd love to know of an application monitoring solution that doesnt' cost an arm and a leg like new relic.

So 4.0! Yes... new asset pipeline to deal with. Harumphhh! Our site was turning out so well in dev but when I deployed through capistrano the asset pipeline got all kinds of messed up. Okay, I spent all friday night just setting up our capistrano 3.0 workflow. That's a whole different story.

But the issue with our asset pipeline lies in a little nifty nginx setting linked in Rails 4.0 documents. I should totally read documentation more carefully.

location ~ ^/(assets)/ {  
     root /projects/www/getbrag/current/public;
     gzip_static on;
     expires 1y;
     add_header Cache-Control public;

Soon as I restarted nginx and thin, it was up and running beautifully.

So lessson to be learned: hackathons are nice when you hangout with friends. And always read your documentation.