我的ruby on rails应用程序大约需要半小时才能完成部署。最长的步骤是
RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile
大约需要1073155ms
每次部署我都需要等待很长时间。
我用
ckeditor
rails_admin
我想是他们拖慢了我的部署,但是我没有证据,我也不知道该怎么做。
解决它。
我的其他环境如下:
rails 4.0.3
ruby 2.1.1
我关于资产的production.rb是
config.serve_static_assets = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true
# Generate digests for assets URLs.
config.assets.digest = true
# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
尝试跳过编译ckeditor资产
config / environments / production.rb
require_relative '../../lib/assets/selective_assets_compressor'
config.assets.js_compressor = SelectiveAssetsCompressor.new
lib /资产/selective_assets_compressor.rb
class SelectiveAssetsCompressor < Uglifier
def initialize(options = {})
super(options)
end
def compress(string)
if string =~ /CKSource/
string
else
super(string)
end
end
end
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句