This gem provides integration of embedding images and fonts as base64 into CSS files within the Rails asset pipeline. More about embedding assets and how it works, see the [jammit documentation]. This gem actually reuses code from that project.
Gemfile gem 'embed-assets-rails', '~> 0.9.1'
install gem install embed-assets-rails -v 0.9.1