title: Manually compiling Sass in Rails 4.2
body: <p>I'm manually compiling Sass in a Rails 4.2 app, and I'm running into issue with Sass' @import.  It's giving me the following error - "File to import not found or unreadable..."    Here's a code snippet.</p>
  
  <pre><code>scheme_css_dir = "#{Rails.root}/app/assets/schemes/#{scheme}/css"
  template = File.read("#{scheme_css_dir}/styles.css.scss")
  
  engine = Sass::Engine.new(template, { 
    :syntax =&gt; :scss,
    :cache =&gt; false,
    :read_cache =&gt; false,
    :style =&gt; :compressed,
    :load_paths =&gt; [scheme_css_dir]
  })
  output = engine.render
  </code></pre>
  
  <p>styles.css.scss contains several @import statements, and it's failing on the first one.  Here's what the first one looks like.</p>
  
  <pre><code>@import "./flexslider";
  </code></pre>
  
  <p>There is a flexslider.css.scss file in the same directory as style.css.scss.  I'm supplying that directory in the :load_paths option.  Interestingly enough, if I change the @import line to...</p>
  
  <pre><code>@import "./flexslider.css.scss";
  </code></pre>
  
  <p>...then it gets to the next @import line in the file - where it throws the same error.  This style.css.scss manifest complies successfully during deploy as is (without adding extensions to all the @imports).</p>
  
  <p>What am I missing?  Is there additional config that I need in order to use Sass::Engine to compile css manifest just like Rails would during deploy?</p>
  
  <p>FYI - I'm using the latest version of sass-rails (5.0.3).</p>
  
  <p>Any help is much appreciated.  Thanks!</p>
  
  <p><strong>UPDATE:</strong>  Thanks to papirtiger's comment, I was able to resolve the issue with @import by updated the extensions of my files from .css.scss to .scss.  However, I'm still running into errors with asset helpers - specifically image-url and font-url.  Here's the error I'm seeing...</p>
  
  <p>undefined method `[]' for nil:NilClass</p>
  
  <p>The error occurs in a sprockets_context method in sprockets (3.1.0) lib/sprockets/sass_processor.rb</p>
  
  <pre><code>def sprockets_context
    options[:sprockets][:context]
  end
  </code></pre>
  
  <p>Any thoughts on how to get pass this hurdle?</p>