我正在Heroku Cedar堆栈上运行rails 3.1 app,它支持资产管道.Heroku 列出了3种编译资产的方法
显然#3对性能有害,而Heroku文档也建议不要这样做.但我不确定#1和#2之间哪个更好.
#1要求您运行rake assets:precompile
并public/assets
在git中包含您的文件夹.你的slug会更大,但我认为部署网站的停机时间会更短.但更大的段塞大小意味着应用程序启动速度较慢,所以也许这是一个洗牌.
由于在Heroku端进行预编译,#2将使部署更新需要更长的时间.但是,你会有一个较小的slu and,而且管理/记忆的次数较少.
我的问题是 - 哪种选择(#1或#2)最适合生产,为什么?
到目前为止它看起来像选项#2但我想确保我不会忽视某些东西.
我准备将我的Rails 3.1应用程序部署到生产环境中,因为我正在使用资产管道,所以我需要预编译我的资产.但是,当我尝试这个时,我得到一个显然与编译jQuery有关的错误:
$ bundle exec rake --trace assets:precompile
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/adam/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /home/adam/.rvm/gems/ruby-1.9.3-p0@rails-3.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
399: unexpected token at '"/*!\u000a * jQuery JavaScript Library v1.7.1\u000a * http://jquery.com/\u000a *\u000a * Copyright 2011, John Resig\u000a * Dual …
Run Code Online (Sandbox Code Playgroud) deployment jquery ruby-on-rails web-deployment ruby-on-rails-3.1