Re:Deploying a Rails 3.1 app in production
by firemanx on Friday May 27, 2011 @02:56AM
(#2590661)
I found this really helpful. I'm a little surprised at the inconsistency of the asset pipeline deployment though. I guess we're all supposed to use erb templates if we intend to use it and include images in our stylesheets?
It strikes me as really strange that they would allow certain functionality which you would get used to in development (images in stylesheets that are automatically matched to assets), then have that completely break when you precompile for production.
Re:Deploying a Rails 3.1 app in production
by bguthrie on Friday May 27, 2011 @04:50AM
(#2590858)
Correct me if I'm wrong, but can't you avoid compiling in production if you package everything as part of your CI build? Rather than deploy off of a git clone, you compile at the end of CI, vendorize your gems, generate a tarball, and push that up.
This minimizes production dependencies (including the need to compile gems live) as long as your CI environment sufficiently resembles prod.
Re:Deploying a Rails 3.1 app in production
by moomerman on Friday May 27, 2011 @05:19AM
(#2590915)
That could be one solution, however there are some problems that spring to mind like deploying to different architectures (common if you're using EC2) - I guess this fits your point about your CI env resembling prod.
Re:Deploying a Rails 3.1 app in production
by jarin on Friday May 27, 2011 @04:21AM
(#2590808)
I couldn't post this in the Facebook comments on the post, but you can fix the Rake 0.9.0 error by putting the following right before load_tasks in your Rakefile:
module ::MyAppName
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
There's a fix on the way, too.
Also, I believe if you're using SASS/SCSS you can interpolate the asset like so, without having to use erb:
Re:Deploying a Rails 3.1 app in production
by moomerman on Friday May 27, 2011 @04:35AM
(#2590824)
Thanks for the info, I'll update the post shortly. Out of interest, what was wrong with the FB comments? I only started using it yesterday because disqus doesn't have a HTTPS option (that I could find anyway).
Re:Deploying a Rails 3.1 app in production
by asolove on Friday May 27, 2011 @09:11AM
(#2591305)
It would be fantastic if someone would release a capistrano/rails plugin that lets you specify when to build the assets and where to send them, for those of us who have static assets on different servers from production Rails apps.
It strikes me as really strange that they would allow certain functionality which you would get used to in development (images in stylesheets that are automatically matched to assets), then have that completely break when you precompile for production.
This minimizes production dependencies (including the need to compile gems live) as long as your CI environment sufficiently resembles prod.
Also, I believe if you're using SASS/SCSS you can interpolate the asset like so, without having to use erb:
Rake 0.9.0 is extremely broken. I recommend reverting to 0.8.7.
[1] http://news.ycombinator.com/item?id=2572790