TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Deploying a Rails 3.1 app in production

46 点作者 vijaydev将近 14 年前

4 条评论

firemanx将近 14 年前
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?<p>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.
bguthrie将近 14 年前
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.<p>This minimizes production dependencies (including the need to compile gems live) as long as your CI environment sufficiently resembles prod.
评论 #2590915 未加载
jarin将近 14 年前
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:<p><pre><code> module ::MyAppName class Application include Rake::DSL end end module ::RakeFileUtils extend Rake::FileUtilsExt end </code></pre> There's a fix on the way, too.<p>Also, I believe if you're using SASS/SCSS you can interpolate the asset like so, without having to use erb:<p><pre><code> background: #00ff00 url(#{asset_path 'rails.png'}) no-repeat fixed center;</code></pre>
评论 #2591055 未加载
评论 #2590824 未加载
评论 #2590887 未加载
评论 #2590873 未加载
评论 #2590890 未加载
asolove将近 14 年前
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.
评论 #2591375 未加载