<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer" nil="true"></assigned-user-id>
  <attachments-count type="integer">0</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2008-10-07T22:16:01+01:00</created-at>
  <creator-id type="integer">18996</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer">9903</milestone-id>
  <number type="integer">1187</number>
  <permalink>binary-files-are-attempted-to-be-pre-compiled-as-erb</permalink>
  <priority type="integer">596</priority>
  <project-id type="integer">8994</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>resolved</state>
  <tag>bug bug edge</tag>
  <title>binary files are attempted to be pre compiled as erb</title>
  <updated-at type="datetime">2008-12-03T16:57:42+00:00</updated-at>
  <user-id type="integer">17393</user-id>
  <user-name>Repository</user-name>
  <creator-name>Roger</creator-name>
  <url>http://rails.lighthouseapp.com/projects/8994/tickets/1187</url>
  <milestone-title>2.x</milestone-title>
  <original-body>With edge rails, I get the following error when trying to compile binary files which are in the views directory:

@filename=&quot;[...]/app/views/simplegrey2/original/grey2/din_mittle.swf&quot;

Here's one I get [fatal]:

/Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:469:in `scan': undefined method `empty?' for nil:NilClass (NoMethodError)
	from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:525:in `compile'
	from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:692:in `initialize'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `new'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `compile'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handler.rb:11:in `call'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/renderable.rb:21:in `_unmemoized_compiled_source'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:57:in `compiled_source'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `__send__'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `memoize_all'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `each'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `memoize_all'
...

Possible fix: rescue and ignore?</original-body>
  <latest-body>With edge rails, I get the following error when trying to compile binary files which are in the views directory:

@filename=&quot;[...]/app/views/simplegrey2/original/grey2/din_mittle.swf&quot;

Here's one I get [fatal]:

/Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:469:in `scan': undefined method `empty?' for nil:NilClass (NoMethodError)
	from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:525:in `compile'
	from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:692:in `initialize'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `new'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `compile'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handler.rb:11:in `call'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/renderable.rb:21:in `_unmemoized_compiled_source'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:57:in `compiled_source'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `__send__'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `memoize_all'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `each'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `memoize_all'
...

Possible fix: rescue and ignore?</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;With edge rails, I get the following error when trying to
compile binary files which are in the views directory:&lt;/p&gt;
&lt;p&gt;
@filename=&quot;[...]/app/views/simplegrey2/original/grey2/din_mittle.swf&quot;&lt;/p&gt;
&lt;p&gt;Here's one I get [fatal]:&lt;/p&gt;
&lt;p&gt;
/Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:469:in
&lt;code&gt;scan': undefined method&lt;/code&gt;empty?' for nil:NilClass
(NoMethodError)&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:525:in `compile'
from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:692:in `initialize'
from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `new'
from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `compile'
from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handler.rb:11:in `call'
from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/renderable.rb:21:in `_unmemoized_compiled_source'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:57:in `compiled_source'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `__send__'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `memoize_all'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `each'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `memoize_all'
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Possible fix: rescue and ignore?&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>With edge rails, I get the following error when trying to compile binary files which are in the views directory:

@filename=&quot;[...]/app/views/simplegrey2/original/grey2/din_mittle.swf&quot;

Here's one I get [fatal]:

/Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:469:in `scan': undefined method `empty?' for nil:NilClass (NoMethodError)
	from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:525:in `compile'
	from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:692:in `initialize'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `new'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `compile'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handler.rb:11:in `call'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/renderable.rb:21:in `_unmemoized_compiled_source'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:57:in `compiled_source'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `__send__'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `memoize_all'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `each'
	from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `memoize_all'
...

Possible fix: rescue and ignore?</body>
      <body-html>&lt;div&gt;&lt;p&gt;With edge rails, I get the following error when trying to
compile binary files which are in the views directory:&lt;/p&gt;
&lt;p&gt;
@filename=&quot;[...]/app/views/simplegrey2/original/grey2/din_mittle.swf&quot;&lt;/p&gt;
&lt;p&gt;Here's one I get [fatal]:&lt;/p&gt;
&lt;p&gt;
/Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:469:in
&lt;code&gt;scan': undefined method&lt;/code&gt;empty?' for nil:NilClass
(NoMethodError)&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:525:in `compile'
from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/1.8/erb.rb:692:in `initialize'
from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `new'
from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb:51:in `compile'
from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/template_handler.rb:11:in `call'
from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/renderable.rb:21:in `_unmemoized_compiled_source'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:57:in `compiled_source'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `__send__'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:25:in `memoize_all'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `each'
from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:22:in `memoize_all'
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Possible fix: rescue and ignore?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-10-07T22:16:01+01:00</created-at>
      <creator-id type="integer">18996</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">1187</number>
      <permalink>binary-files-are-attempted-to-be-pre-compiled-as-erb</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>bug edge</tag>
      <title>binary files are attempted to be pre compiled as erb</title>
      <updated-at type="datetime">2008-10-07T22:16:03+01:00</updated-at>
      <user-id type="integer">18996</user-id>
      <user-name>Roger</user-name>
      <creator-name>Roger</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/1187</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>--- a/actionpack/lib/action_view/template_handlers/erb.rb
+++ b/actionpack/lib/action_view/template_handlers/erb.rb
@@ -48,11 +48,14 @@ module ActionView
       self.erb_trim_mode = '-'
 
       def compile(template)
+       begin
         src = ::ERB.new(&quot;&lt;% __in_erb_template=true %&gt;#{template.source}&quot;, nil, erb_trim_mode, '@output_buffer').src
 
         # Ruby 1.9 prepends an encoding to the source. However this is
         # useless because you can only set an encoding on the first line
         RUBY_VERSION &gt;= '1.9' ? src.sub(/\A#coding:.*\n/, '') : src
+       rescue Exception
+       end
       end
     end
   end

seems to be a temporary fix. Better might be to only erb compile .rhtml or .html.erb files :)</body>
      <body-html>&lt;div&gt;&lt;p&gt;--- a/actionpack/lib/action_view/template_handlers/erb.rb +++
b/actionpack/lib/action_view/template_handlers/erb.rb @@ -48,11
+48,14 @@ module ActionView&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;   self.erb_trim_mode = '-'

   def compile(template)
&lt;/code&gt;
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;begin
 src = ::ERB.new(&quot;&amp;lt;% __in_erb_template=true %&amp;gt;#{template.source}&quot;, nil, erb_trim_mode, '@output_buffer').src

 # Ruby 1.9 prepends an encoding to the source. However this is
 # useless because you can only set an encoding on the first line
 RUBY_VERSION &amp;gt;= '1.9' ? src.sub(/\A#coding:.*\n/, '') : src
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;rescue Exception
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;end
&lt;/code&gt;
&lt;/pre&gt;
end end end&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;seems to be a temporary fix. Better might be to only erb compile
.rhtml or .html.erb files :)&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-10-10T19:47:02+01:00</created-at>
      <creator-id type="integer">18996</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: bug edge
</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">1187</number>
      <permalink>binary-files-are-attempted-to-be-pre-compiled-as-erb</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>bug bug edge</tag>
      <title>binary files are attempted to be pre compiled as erb</title>
      <updated-at type="datetime">2008-10-10T19:47:05+01:00</updated-at>
      <user-id type="integer">18996</user-id>
      <user-name>Roger</user-name>
      <creator-name>Roger</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/1187</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Is there a good reason why you don't put this static content in /public/simplegrey2/original/grey2/din_mittle.swf

Putting it inside /app/views makes rails deal with it, putting it in public makes the web server deal with it.

Basically, if you don't need rails to handle it, stick it in public, otherwise you are wasting valuable mongrel/whatever time dealing with stuff that apache/nginx is better at shifting.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Is there a good reason why you don't put this static content in
/public/simplegrey2/original/grey2/din_mittle.swf&lt;/p&gt;
&lt;p&gt;Putting it inside /app/views makes rails deal with it, putting
it in public makes the web server deal with it.&lt;/p&gt;
&lt;p&gt;Basically, if you don't need rails to handle it, stick it in
public, otherwise you are wasting valuable mongrel/whatever time
dealing with stuff that apache/nginx is better at shifting.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-10-11T16:07:15+01:00</created-at>
      <creator-id type="integer">18996</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">1187</number>
      <permalink>binary-files-are-attempted-to-be-pre-compiled-as-erb</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>bug bug edge</tag>
      <title>binary files are attempted to be pre compiled as erb</title>
      <updated-at type="datetime">2008-10-11T16:07:19+01:00</updated-at>
      <user-id type="integer">28420</user-id>
      <user-name>Tom Lea</user-name>
      <creator-name>Roger</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/1187</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Nope. I was just pointing out a difference [&quot;gotcha&quot;] between 2.1 and edge.  If it's a good gotcha then I guess leave it in there ? I'm not sure :)</body>
      <body-html>&lt;div&gt;&lt;p&gt;Nope. I was just pointing out a difference [&quot;gotcha&quot;] between
2.1 and edge. If it's a good gotcha then I guess leave it in there
? I'm not sure :)&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-10-11T18:53:30+01:00</created-at>
      <creator-id type="integer">18996</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">1187</number>
      <permalink>binary-files-are-attempted-to-be-pre-compiled-as-erb</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>bug bug edge</tag>
      <title>binary files are attempted to be pre compiled as erb</title>
      <updated-at type="datetime">2008-10-11T18:53:35+01:00</updated-at>
      <user-id type="integer">18996</user-id>
      <user-name>Roger</user-name>
      <creator-name>Roger</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/1187</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>(from [2fc6c7dd05b9481ed81fe19c8fc0cc7915868404]) Validate template extensions [#1187 state:resolved]
http://github.com/rails/rails/commit/2fc6c7dd05b9481ed81fe19c8fc0cc7915868404</body>
      <body-html>&lt;div&gt;&lt;p&gt;(from [2fc6c7dd05b9481ed81fe19c8fc0cc7915868404]) Validate
template extensions [&lt;a href=&quot;/projects/8994/tickets/1187&quot; title=&quot;Ticket #1187&quot;&gt;#1187&lt;/a&gt; state:resolved] &lt;a href=&quot;http://github.com/rails/rails/commit/2fc6c7dd05b9481ed81fe19c8fc0cc7915868404&quot;&gt;
http://github.com/rails/rails/co...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-12-03T16:57:41+00:00</created-at>
      <creator-id type="integer">18996</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">1187</number>
      <permalink>binary-files-are-attempted-to-be-pre-compiled-as-erb</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag>bug bug edge</tag>
      <title>binary files are attempted to be pre compiled as erb</title>
      <updated-at type="datetime">2008-12-03T16:57:42+00:00</updated-at>
      <user-id type="integer">17393</user-id>
      <user-name>Repository</user-name>
      <creator-name>Roger</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/1187</url>
      <milestone-title>2.x</milestone-title>
    </version>
  </versions>
</ticket>
