I follwed the example here: http://dekstop.de/weblog/2005/12/rails_inflector_in_ruby_scripts/ #!/usr/bin/ruby require ''rubygems'' require ''active_support/inflector'' puts Inflector.singularize(''inflections'') I loaded it into irb and wrote a killer script both of which worked perfectly for weeks. Now when I try and run the script or run these simple example lines of code it doesn''t work anymore. And I can''t for the life of me figure out what I changed to break it! The last line gives me this error: irb(main):003:0> puts Inflector.singularize(''inflections'') NameError: uninitialized constant Inflector from (irb):3 Does anybody know what might cause this? Is it a new plugin (like action-mailer) that I installed? Is it a bad environmental variable? Thanks, Dave --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Quoting dschruth <dschruth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > I follwed the example here: > http://dekstop.de/weblog/2005/12/rails_inflector_in_ruby_scripts/ > > #!/usr/bin/ruby > require ''rubygems'' > require ''active_support/inflector'' > puts Inflector.singularize(''inflections'') > > I loaded it into irb and wrote a killer script both of which worked > perfectly for weeks. > > Now when I try and run the script or run these simple example lines of > code it doesn''t work anymore. And I can''t for the life of me figure > out what I changed to break it! The last line gives me this error: > > irb(main):003:0> puts Inflector.singularize(''inflections'') > NameError: uninitialized constant Inflector > from (irb):3 >Probably you updated Rails to 2.1.1. The above usage is now deprecated and gives a warning to that effect in Rails. Don''t know why no warning in straight Ruby. Anyway, try puts ActiveSupport::Inflector.singularize(''inflections'') HTH, Jeffrey --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks that worked! On Sep 20, 7:22 am, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Quoting dschruth <dschr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > > > I follwed the example here: > >http://dekstop.de/weblog/2005/12/rails_inflector_in_ruby_scripts/ > > > #!/usr/bin/ruby > > require ''rubygems'' > > require ''active_support/inflector'' > > puts Inflector.singularize(''inflections'') > > > I loaded it into irb and wrote a killer script both of which worked > > perfectly for weeks. > > > Now when I try and run the script or run these simple example lines of > > code it doesn''t work anymore. And I can''t for the life of me figure > > out what I changed to break it! The last line gives me this error: > > > irb(main):003:0> puts Inflector.singularize(''inflections'') > > NameError: uninitialized constant Inflector > > from (irb):3 > > Probably you updated Rails to 2.1.1. The above usage is now deprecated and > gives a warning to that effect in Rails. Don''t know why no warning in > straight Ruby. Anyway, try > > puts ActiveSupport::Inflector.singularize(''inflections'') > > HTH, > Jeffrey--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---