# Edge rails: \`scan': undefined method \`empty?' for nil:NilCla

**URL:** <https://www.ruby-forum.com/t/edge-rails-scan-undefined-method-empty-for-nil-nilcla/149960>\
**Category:** Rails\
**Created:** [October 1, 2008, 5:59pm UTC](https://www.ruby-forum.com/t/edge-rails-scan-undefined-method-empty-for-nil-nilcla/149960 "2008-10-01T17:59:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [October 1, 2008, 5:59pm UTC](https://www.ruby-forum.com/t/edge-rails-scan-undefined-method-empty-for-nil-nilcla/149960/1 "2008-10-01T17:59:08Z")

</div>

Anybody possibly know what’s going on?

upgrading my existing rails app to edge results in this error

thoughts?

/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:53:in  
`compiled_source' from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:21:in` **send** ’  
from  
/Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active\_support/memoizable.rb:21:in  
`memoize_all' from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:18:in`each’  
from  
/Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active\_support/memoizable.rb:18:in  
`memoize_all' from /Users/rogerpack/dev/degreesearch/vendor/rails/activesupport/lib/active_support/memoizable.rb:13:in`freeze’  
from  
/Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action\_view/paths.rb:88:in  
`reload!' from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/paths.rb:102:in`templates\_in\_path’  
from  
/Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action\_view/paths.rb:100:in  
`each' from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/paths.rb:100:in`templates\_in\_path’  
from  
/Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action\_view/paths.rb:86:in  
`reload!' from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/paths.rb:78:in`load’  
from  
/Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action\_view/paths.rb:109:in  
`load' from /Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action_view/paths.rb:109:in`each’  
from  
/Users/rogerpack/dev/degreesearch/vendor/rails/actionpack/lib/action\_view/paths.rb:109:in  
`load' from /Users/rogerpack/dev/degreesearch/config/../vendor/rails/railties/lib/initializer.rb:350:in`load\_view\_paths’  
from  
/Users/rogerpack/dev/degreesearch/config/…/vendor/rails/railties/lib/initializer.rb:177:in  
`process' from /Users/rogerpack/dev/degreesearch/config/../vendor/rails/railties/lib/initializer.rb:110:in`send’  
from  
/Users/rogerpack/dev/degreesearch/config/…/vendor/rails/railties/lib/initializer.rb:110:in  
`run' from /Users/rogerpack/dev/degreesearch/config/environment.rb:15 from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
from  
/Users/rogerpack/dev/ruby\_186\_installed/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:31:in`load\_application’  
from  
/Users/rogerpack/dev/ruby\_186\_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:23:in  
`initialize' from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/loader.rb:32:in`new’  
from  
/Users/rogerpack/dev/ruby\_186\_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/loader.rb:32:in  
`for' from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/controllers/controller.rb:162:in`load\_adapter’  
from  
/Users/rogerpack/dev/ruby\_186\_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/controllers/controller.rb:66:in  
`start' from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in`send’  
from  
/Users/rogerpack/dev/ruby\_186\_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in  
`run_command' from /Users/rogerpack/dev/ruby_186_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:136:in`run!’  
from  
/Users/rogerpack/dev/ruby\_186\_installed/lib/ruby/gems/1.8/gems/thin-0.8.2/bin/thin:6  
from /Users/rogerpack/dev/ruby\_186\_installed/bin/thin:20:in `load’  
from /Users/rogerpack/dev/ruby\_186\_installed/bin/thin:20

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [November 27, 2008, 2:25am UTC](https://www.ruby-forum.com/t/edge-rails-scan-undefined-method-empty-for-nil-nilcla/149960/2 "2008-11-27T02:25:27Z")

</div>

I’ve been seeing the same problem when trying to upgrade an application  
from Rails 2.1.2 to 2.2.2. I had set up a controller to serve static  
content wrapped in the site’s template. One of the users dropped some  
JPEG files into the /app/views/static directory, and that seems to be  
jamming up the works with 2.2.2.

Now I know how to solve the problem (by removing the the non-.html.erb  
files), but I’m wondering why there is a difference between 2.1.2 and  
2.2.2.

–jeff

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [November 30, 2008, 6:38am UTC](https://www.ruby-forum.com/t/edge-rails-scan-undefined-method-empty-for-nil-nilcla/149960/3 "2008-11-30T06:38:41Z")

</div>

> Now I know how to solve the problem (by removing the the non-.html.erb  
> files), but I’m wondering why there is a difference between 2.1.2 and  
> 2.2.2.

Theoretically it was to allow for all the erb templates to be loaded up  
once at load time [it just happens to attempt this weirdness with non  
erb files, too…I’m not sure if it’s a bug or not…I believe I filed a  
report of it on lighthouse].  
Cheers!  
-=R

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [January 19, 2009, 11:53am UTC](https://www.ruby-forum.com/t/edge-rails-scan-undefined-method-empty-for-nil-nilcla/149960/4 "2009-01-19T11:53:17Z")

</div>

Is there any way to exclude certain template file types (or non-  
template files) from being preloaded, say by their file type?  
Specifically, I was thinking of jpeg, swf files, etc. which we do not  
(!) wish to be loaded/parsed at startup time.  
Could there be a configuration option which handles this?

On Nov 30 2008, 7:38 am, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [January 19, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/edge-rails-scan-undefined-method-empty-for-nil-nilcla/149960/5 "2009-01-19T21:51:19Z")

</div>

Yitzhak Bar G. wrote:

> Is there any way to exclude certain template file types (or non-  
> template files) from being preloaded, say by their file type?  
> Specifically, I was thinking of jpeg, swf files, etc. which we do not  
> (!) wish to be loaded/parsed at startup time.  
> Could there be a configuration option which handles this?

I think that trunk was updated recently to handle them better [i.e. only .rhtml → compile].

[http://rails.lighthouseapp.com/projects/8994/tickets/1187-binary-files-are-attempted-to-be-pre-compiled-as-erb#ticket-1187-2](http://rails.lighthouseapp.com/projects/8994/tickets/1187-binary-files-are-attempted-to-be-pre-compiled-as-erb#ticket-1187-2)

GL!
