# Error --\> undefined method 'length' for nil:NilClass

**URL:** <https://www.ruby-forum.com/t/error-undefined-method-length-for-nil-nilclass/164583>\
**Category:** IronRuby\
**Created:** [April 2, 2009, 7:20pm UTC](https://www.ruby-forum.com/t/error-undefined-method-length-for-nil-nilclass/164583 "2009-04-02T19:20:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_J.on](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/46a35a/32.png) [@Robert\_J.on](https://www.ruby-forum.com/u/Robert_J.on)\
**Post date:** [April 2, 2009, 7:20pm UTC](https://www.ruby-forum.com/t/error-undefined-method-length-for-nil-nilclass/164583/1 "2009-04-02T19:20:40Z")

</div>

## I just updated my local repo from gitHub and when I run rake compile I see the following error:

C:\Users\Robert\bob-code-repo\ironruby\_working\Merlin\Main\Languages\Ruby\>rake  
compile  
(in  
C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby)  
rake aborted!  
undefined method `length’ for nil:NilClass

## (See full trace by running task with --trace)

I ran rake with “–trace” and the following was the result:

* * *

## C:\Users\Robert\bob-code-repo\ironruby\_working\Merlin\Main\Languages\Ruby\>rake c ompile --trace (in C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby) \*\* Invoke compile (first\_time) \*\* Invoke happy (first\_time) \*\* Execute happy rake aborted! undefined method `length' for nil:NilClass C:/ruby/lib/ruby/gems/1.8/gems/pathname2-1.6.1/lib/pathname2.rb:100:in`initiali ze’ C:/ruby/lib/ruby/gems/1.8/gems/pathname2-1.6.1/lib/pathname2.rb:665:in `new' C:/ruby/lib/ruby/gems/1.8/gems/pathname2-1.6.1/lib/pathname2.rb:665:in`+’ C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:30:in `path_exists?' C:/Users/Robert/bob-code-repo/ironruby_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:29:in`each’ C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:29:in `path_exists?' C:/Users/Robert/bob-code-repo/ironruby_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:103 C:/Users/Robert/bob-code-repo/ironruby_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:102:in`each’ C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:102 C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in`execute’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in`execute’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:in`synchronize’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_c hain' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in`invoke\_prerequisit es’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in`invoke\_prerequisit es’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:in`synchronize’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_c hain' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in`invoke’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in `invoke_task' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in`top\_level’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in`top\_level’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exceptio n_handling' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in`top\_level’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in`standard\_exceptio n\_handling’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 c:/ruby/bin/rake:19:in`load’ c:/ruby/bin/rake:19

Does anyone have any idea whats happening ?

Robert

---

<div class="post-metadata">

**Author:** ![Robert\_J.on](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/46a35a/32.png) [@Robert\_J.on](https://www.ruby-forum.com/u/Robert_J.on)\
**Post date:** [April 2, 2009, 8:02pm UTC](https://www.ruby-forum.com/t/error-undefined-method-length-for-nil-nilclass/164583/2 "2009-04-02T20:02:53Z")

</div>

It’s probably related to Merlin\External moving to  
Merlin\External.LCA\_RESTRICTED. I’ll figure it out and push out a new  
revision in a few hours.

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Robert J.on  
Sent: Thursday, April 02, 2009 9:58 AM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] error → undefined method ‘length’ for  
nil:NilClass

I just updated my local repo from gitHub and when I run rake compile I  
see the following error:

* * *

C:\Users\Robert\bob-code-repo\ironruby\_working\Merlin\Main\Languages\Ruby\>rake  
compile  
(in  
C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby)  
rake aborted!  
undefined method `length’ for nil:NilClass

## (See full trace by running task with --trace)

I ran rake with “–trace” and the following was the result:

* * *

## C:\Users\Robert\bob-code-repo\ironruby\_working\Merlin\Main\Languages\Ruby\>rake c ompile --trace (in C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby) \*\* Invoke compile (first\_time) \*\* Invoke happy (first\_time) \*\* Execute happy rake aborted! undefined method `length' for nil:NilClass C:/ruby/lib/ruby/gems/1.8/gems/pathname2-1.6.1/lib/pathname2.rb:100:in `initiali ze’ C:/ruby/lib/ruby/gems/1.8/gems/pathname2-1.6.1/lib/pathname2.rb:665:in `new' C:/ruby/lib/ruby/gems/1.8/gems/pathname2-1.6.1/lib/pathname2.rb:665:in `+’ C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:30:in `path_exists?' C:/Users/Robert/bob-code-repo/ironruby_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:29:in `each’ C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:29:in `path_exists?' C:/Users/Robert/bob-code-repo/ironruby_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:103 C:/Users/Robert/bob-code-repo/ironruby_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:102:in `each’ C:/Users/Robert/bob-code-repo/ironruby\_working/Merlin/Main/Languages/Ruby/rake/m isc.rake:102 C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_c hain' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in `invoke\_prerequisit es’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `invoke\_prerequisit es’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_c hain' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in `invoke_task' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top\_level’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top\_level’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exceptio n_handling' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top\_level’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard\_exceptio n\_handling’ C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 c:/ruby/bin/rake:19:in `load’ c:/ruby/bin/rake:19

Does anyone have any idea whats happening ?

Robert
