set config.assets.initialize_on_precompile=true for Rails4