Re: [Puppet Users] Re: undefined method each for #String:

2013-07-15 Thread Josh Cooper
On Thu, Jul 11, 2013 at 2:34 PM, Greg Chavez greg.cha...@gmail.com wrote:

 Removing ruby1.9.1 fixed the problem.

 On Thu, Jul 11, 2013 at 5:22 PM, Greg Chavez greg.cha...@gmail.com
 wrote:
  I run puppet 3.2.2 on about 500 RedHat 5/6 systems.  I have about 15
  Ubuntu servers that run OpenStack; today I added the stdlib module to
  take advantage of the file_line type in a new module I had written AND
  I upgraded the puppet clients from 2.7 to match the other RedHat
  clients.  This automatically upgraded ruby from 1.8 to 1.9.
 
  The first run of puppet agent successfully applied my new module, but
  each subsequent run results in this error:
 
  root@ceph-cs-sn-06i:/var/lib/puppet/lib/facter# puppet agent -t
  Info: Retrieving plugin
  Error: Could not retrieve local facts: undefined method `each' for
  #String:0x000259f630
  Error: Failed to apply catalog: Could not retrieve local facts:
  undefined method `each' for #String:0x000259f630
 
  The problem here is that I use each a lot.  How can I troubleshoot
  this further, and is it possible that something has changed in ruby
  1.9 that is causing this?
 
  Thanks.
 
  --
  \*..+.-
  --Greg Chavez
  +//..;};



 --
 \*..+.-
 --Greg Chavez
 +//..;};

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To post to this group, send email to puppet-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/puppet-users.
 For more options, visit https://groups.google.com/groups/opt_out.



Ruby 1.8 automatically coerces strings and single-element arrays, so
string becomes [string], and #each can be called on it. Ruby 1.9 does
not do this, so things magically break.

Can you run `puppet agent -t --trace`? If the issue is not with a custom
fact you've written, please file a ticket in redmine against facter and
include the relevant stacktrace.

Josh

-- 
Josh Cooper
Developer, Puppet Labs

*Join us at PuppetConf 2013, August 22-23 in San Francisco - *
http://bit.ly/pupconf13*
**Register now and take advantage of the Early Bird discount - save 25%!*

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: undefined method each for #String:

2013-07-11 Thread Greg Chavez
Removing ruby1.9.1 fixed the problem.

On Thu, Jul 11, 2013 at 5:22 PM, Greg Chavez greg.cha...@gmail.com wrote:
 I run puppet 3.2.2 on about 500 RedHat 5/6 systems.  I have about 15
 Ubuntu servers that run OpenStack; today I added the stdlib module to
 take advantage of the file_line type in a new module I had written AND
 I upgraded the puppet clients from 2.7 to match the other RedHat
 clients.  This automatically upgraded ruby from 1.8 to 1.9.

 The first run of puppet agent successfully applied my new module, but
 each subsequent run results in this error:

 root@ceph-cs-sn-06i:/var/lib/puppet/lib/facter# puppet agent -t
 Info: Retrieving plugin
 Error: Could not retrieve local facts: undefined method `each' for
 #String:0x000259f630
 Error: Failed to apply catalog: Could not retrieve local facts:
 undefined method `each' for #String:0x000259f630

 The problem here is that I use each a lot.  How can I troubleshoot
 this further, and is it possible that something has changed in ruby
 1.9 that is causing this?

 Thanks.

 --
 \*..+.-
 --Greg Chavez
 +//..;};



-- 
\*..+.-
--Greg Chavez
+//..;};

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.