From: Gennady Bystritsky Date: 2010-06-17T11:30:17+09:00 Subject: Re: Help with errors: On Jun 16, 2010, at 6:48 PM, Ted Flethuseo wrote: > Hi everyone, > > I was running some scripts but the following lines are giving > me errors. Now I"m not sure if this methods don't exist in ruby > or I don't have the libraries for them: > > > NoMethodError: undefined method `sync=' for IO:Class > > at top level in writeFile.rb at line 26 > > > NameError: undefined local variable or method ‘ruby_ode’ for main:Object > > at top level in whitespace.rb at line 12 > > How do I update this libraries for ruby on a Mac, without ending up with > two different copies of ruby. How about the following solution? Beautiful, isn't it? ;-) Hope it helps, Gennady. P.S. And seriously, where's the code that does not work? As a not so wild guess, you use a class method instead of the instance one. --------------------------------------------------------------- IO#sync= ios.sync = boolean => boolean ------------------------------------------------------------------------ Sets the ``sync mode'' to true or false. When sync mode is true, all output is immediately flushed to the underlying operating system and is not buffered internally. Returns the new state. See also IO#fsync. f = File.new("testfile") f.sync = true (produces no output)