For work in the environment of development and production do not use
Rails.application.assets.find_asset(logical_file_path).to_s
for sprockets-rails version 3.0.0 , but use this (compass rails required):
CompassRails.sprockets.find_asset(logical_file_path).to_s
If you are not using garm compass-rails, you can get the asset with:
(Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)).find_asset(logical_file_path).to_s
source share