<p>I've spent a good hour debugging why the <strong>.svg</strong> file from my <a href="https://github.com/mrfoto/swipebox">swipebox gem</a> wasn't being precompiled by the <strong>Rails Asset Pipeline</strong>. I'm still not sure why, because it works with .svg fonts but for some reason it didn't want to "grab" the swipebox-icons.svg file.</p><p>The way I solved is I added an <strong>initializer</strong> to my Engine class which adds all the images (just in case) to the <code>config.assets.precompile</code> setting:</p><pre><code>module Swipebox
class Engine < ::Rails::Engine
initializer 'swipebox.assets.precompile' do |app|
app.config.assets.precompile << %r(swipebox-[\w]+\.(?:png|svg|gif)$)
</code></pre><p>Hope it helps someone :)</p>
Get New Tutorials Delivered to Your Inbox
New tutorials will be sent to your Inbox once a week.