From: James Gray Date: 2008-07-06T02:40:43+09:00 Subject: Re: Don't understand NoMethodError On Jul 5, 2008, at 12:24 PM, Michael Lommel wrote: > Here is the code so far: > newfile = File.open(filename, "r"){|f| f.read}.ukquotes.ukspell > Produces this error message: > > > cw-replace.rb:44: private method `ukquotes' called for > # (NoMethodError) > from cw-replace.rb:43:in `each' > In the line shown above, you read the contents of a file into a String, then try to call the ukquotes() method on that String. You didn't define that method for Strings though. Instead, you defined it to have the String passed in as an argument. Thus, you probably want to rewrite that line as something like: newfile = ukspell(ukquotes(File.read(filename))) I hope that helps. James Edward Gray II