not playing well with rails 3.1 and sprockets
jejacks0n opened this issue · 14 comments
The mounted evergreen rack app for Rails is working great, and because the Rails stack includes sprockets you can access assets through it. The problem arises when you run evergreen serve, or rake spec:javascripts when using the Rails 3.1 asset features.
I'm using coffeescript, and thus need sprockets to do the preprocessing for me for several reasons.
I've made a simple patch that includes sprockets into evergreen much how the sprockets railtie does for Rails, and I'm submitting this in case anyone else comes across the same problem. I may fork the project and get this in proper if it's something that isn't already being addressed.
I use the /config/evergreen.rb file to make my configurations and adjustments, and here's a gist of what I've done for integrating sprockets: https://gist.github.com/990160
I've been wanting to work on this too, I'd really like for this to work nicely out of the box. I've had some problems getting Rails 3.1 to run, which is why I haven't looked into it too much. Also it seems like there might still be some API changes going on before 3.1 final, which means we might be better off waiting this out just a little while until we know what the final API looks like.
I spun up a fresh rails 3.1.rc1 app yesterday and started dropping in all of our usual tools to see how things worked. It all looked good until I got to evergreen. I'm very excited about seeing evergreen work nicely with 3.1. I'll keep an eye out and give it a whirl when there's a fix in place.
the gist was working for rails 3.1.rc4, but stopped in rails 3.1.rc5 :/
Updated the gist and it's working again.. the method in which paths are added to sprockets was changed. It should be noted that I just updated the gist to behave more like the railtie (found in actionpack/lib/sprockets).
gist is broken again with sprockets 2.0.0 that was just released because static_root was removed in sstephenson/sprockets@122b95d
Updated the gist at https://gist.github.com/1180946 to work with sprockets 2.0.0
Note: in development environment with class_cache = true it will crash. Not sure if it happened with previous gists or not.
Hey guys, the gists are working great as a temporary fix. Thanks.
How are you working around assets embedded in gems, like jquery-rails? Adding the path to the config manually ?
Thanks for the heads up.. I haven't been able to keep up with the rails 3.1 rcs.. it's actually a bit frustrating.
Anyhow, I updated the gist again, thanks to vizjeral. I also added another one, which is somewhat unrelated.. I like my specs to be in nested paths based on where they're located in the actual app, so I also have the following in my evergreen.rb https://gist.github.com/1182530
At some point I should probably fork and try and get my changes in so they don't break eventually.. but until I have time that might also help someone.
I love how accurate the comment by jnicklas was -- way back on May 24, 2011.. he pretty much nailed it on the head.
Now that Rails 3.1 is released, this is at the top of my list of things to do. I'll try to fix Evergreen to work with the asset pipeline as soon as I can. Hopefully within a week or so.
+1
This is now fixed on the master branch. Release imminent!