title: Difference between File.load and File.read in Ruby
body: <p>I am trying to follow Sass -> CSS converter code on <a href="http://sass-lang.com/docs/yardoc/Sass/Engine.html#render-instance_method" rel="nofollow">Sass website</a>.</p>
  
  
  
  <pre><code>template = File.load('stylesheets/sassy.sass')
  sass_engine = Sass::Engine.new(template)
  output = sass_engine.render
  puts output
  </code></pre>
  
  <p>And I get this error while I'm trying to <code>File.load</code></p>
  
  <pre><code>SyntaxError in PublishController#index
  
  /Users/jkim/rails/support-rhapsody/app/assets/stylesheets/application.sass:1: target of repeat operator is not specified: /* http:/
  /Users/jkim/rails/support-rhapsody/app/assets/stylesheets/application.sass:2: no .&lt;digit&gt; floating literal anymore; put 0 before dot
     v2.0 | 20110126
        ^
  /Users/jkim/rails/support-rhapsody/app/assets/stylesheets/application.sass:2: syntax error, unexpected tINTEGER
     v2.0 | 20110126
         ^
  /Users/jkim/rails/support-rhapsody/app/assets/stylesheets/application.sass:3: syntax error, unexpected ':', expecting $end
     License: none (public domain) */
  </code></pre>
  
  <p>But when I do File.read, it works fine until <code>output = sass_engine.render</code>.</p>
  
  <p>I get this error, </p>
  
  <pre><code>NoMethodError in PublishController#index
  
  undefined method `[]' for nil:NilClass
  </code></pre>
  
  <p>What's the difference between File.read and File.load? And if you know how to fix this problem in Sass, even better.</p>