- From: "Oliver Rojo" <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: undefined method `[]' for nil:NilClass
- Date: Thu, 18 Feb 2010 09:26:56 +0000
from the way it looks, its an array. can you recommend other method?
----- Original Message -----
From: Alex Soto
[mailto:
To:
Sent: Thu, 18 Feb 2010
09:13:18 +0000
Subject: [chef] Re: Re: Re: Re: undefined method `[]' for
nil:NilClass
>
Should work assuming localhost is not already nil to begin with. I don't
>
know what localhost is so tough for me to give more help. Is it a string,
>
array, hash, etc?
>
>
Alex
>
>
On Feb 18, 2010, at 1:04 AM, Oliver Rojo wrote:
>
>
> By the way, on the default recipe script, I defined the variable this way:
>
>
>
> variables(:localhost => localhost, :hosts => hosts)
>
>
>
> and calling it on the templates:
>
> localip <%= @localhost["ipaddress"] %>
>
>
>
>
>
>
>
>
>
> ----- Original Message -----
>
> From: Oliver Rojo
>
> [mailto:
>
> To:
>
>
>
> Sent: Thu, 18 Feb
>
> 2010 08:56:17 +0000
>
> Subject: [chef] Re: Re: undefined method `[]' for
>
> nil:NilClass
>
>
>
>
>
>>
>
>> ----- Original Message -----
>
>> From: Alex Soto
>
>> [mailto:
>
>> To:
>
>>
>
>> Sent: Thu, 18 Feb 2010
>
>> 08:45:31 +0000
>
>> Subject: [chef] Re: undefined method `[]' for nil:NilClass
>
>>
>
>>
>
>>> @node is how to get node attributes unless you defined a variable named
>
>>> localhost.
>
>>
>
>> Tried changing @localhost to @node but the same error still exists.
>
>>>
>
>>> On Feb 18, 2010, at 12:37 AM, Oliver Rojo wrote:
>
>>>
>
>>>> How can i fix this error?
>
>>>>
>
>>>> Chef::Mixin::Template::TemplateError (undefined method `[]' for
>
>>> nil:NilClass)
>
>>>>
>
>>>> I'm using:
>
>>>>
>
>>>> <%= @localhost["ipaddress"] %> on one of my template and suddenly after
>
>>> running chef-client, it stops with the above error.
>
>>>>
>
>>>> Please help!
>
>>>>
>
>>>> Oliver
>
>>>
>
>>>
>
>>
>
>
- [chef] Re: Re: Re: Re: Re: undefined method `[]' for nil:NilClass, Oliver Rojo, 02/18/2010
Archive powered by MHonArc 2.6.16.