[chef] Re: Re: ruby syntax issue or may be chef command


Chronological Thread 
  • From: Manoj Thakkar < >
  • To: " " < >
  • Subject: [chef] Re: Re: ruby syntax issue or may be chef command
  • Date: Wed, 30 Oct 2013 09:37:42 -0700

Thanks Mark,

i thought i am setting a node attribute of type string, All i want to do is set an array of string in my ruby block and then use it outside the ruby block.

is there another way to do it ?

Thanks
Manoj



On Wed, Oct 30, 2013 at 5:08 AM, Marc Paradise < " target="_blank"> > wrote:

Hi Manoj, it looks like you're assigning a string to node['account_deploy'] via '.last': .

    deploy = line.split(':').last
    deploy = deploy.gsub(/\n/," ")
    node.set['account_deploy']=deploy

And then calling .each on it, which is not a member of String:  
 
node['account_deploy'].each do |x|


[2013-10-30T01:45:07-07:00] FATAL: NoMethodError: undefined method `each' for "\"acc1\",\"acc2\" ":String



--
Marc Paradise 
Software Engineer
Opscode

Twitter: @MarcParadise
freenode: mparadise





Archive powered by MHonArc 2.6.16.

§