In Gemfile add:
gem 'rails_12factor'
In config/environments/production.rb add
config.assets.compile = false #To stop run time assets precompile in production.
config.assets.digest = true #To access assets which are precompiled and in their names have appendend digets by rails
config.cache_classes = true #allowing caching assets
In config/application.rb add
replace this
Bundler.require(:default, Rails.env)
with this
Bundler.require(:default, :assets, Rails.env)
Also add these lines
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
Thanks taimoor.changaiz, it is working fine for me now, but the images in not loading from assets. Please tell me is that any solution for this.