title: Rails File.exist? yields false when file is present
body: <p>I've found a few posts here regarding File.exists? in a Rails app but trying the solutions have not helped, I'm fairly new so I must be doing something dumb.</p>
  
  <p>I'm using:</p>
  
  <ul>
  <li>Rails 3.2.11</li>
  <li>Ruby 1.9.3</li>
  <li>Paperclip for the file mentioned below</li>
  <li>ActiveAdmin to upload the file mentioned below</li>
  <li>Working in development environment</li>
  <li>Assets not precompiled</li>
  </ul>
  
  <p>I have a model "style" and it has an image attachment, I can render the image with</p>
  
  <pre><code>&lt;%= image_tag(@style.style_image) %&gt;
  </code></pre>
  
  <p>and it works just fine.</p>
  
  <p>In short, I want to check if the file image is actually there in the folder it should be in - I don't want to use <strong>@style.style_image.present?</strong> for checking images because that just checks the db record. I want to use <strong>File.exist?</strong> to see if there's actually a file for <strong>@style.style_image</strong>.</p>
  
  <p>So in my view file, I have the code</p>
  
  <pre><code>&lt;% if File.exist?(@style.style_image.url) %&gt;
  The image exists.
  &lt;% else %&gt;
  The image is not here.
  &lt;% end %&gt;
  </code></pre>
  
  <p>And it always prints "the image is not here" when I load the page. Directly below I am displaying my image using image_tag, so I know for fact that the image is there.</p>
  
  <p>I've also tried</p>
  
  <pre><code>&lt;% if File.exist?(Rails.root + @style.style_image.url) %&gt;
  </code></pre>
  
  <p>with no luck. I also tried using FileTest.exist?, FileTest.exists?, and File.exists? but none will tell me true when the image is definitely there.</p>
  
  <p>Is there something I'm missing? Any guidance would be appreciated very much. I'm only a few months into Ruby and Rails so I'm probably missing something dumb.</p>