Ted F. wrote:
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
Show your code, i.e. contents of writeFile.rb around that line.
It looks to me like you’ve written
IO.sync = true
which won’t work - exactly as the error says, there’s no sync= method
for the IO class.
This method exists for instances of IO. For example:
fd = File.open("foo","w") # returns an instance of IO subclass
fd.sync = true
NameError: undefined local variable or method ‘ruby_ode’ for main:Object
at top level in whitespace.rb at line 12
Again, this looks like a bug in line 12 of whitespace.rb, which I
presume is your code since the error doesn’t say
/path/to/some/lib/whitespace.rb.
You are trying to invoke a non-existent method called “ruby_ode”. Why do
you think that such a method exists? Did you define it earlier? Is it in
some library, did you remember to require the library?
How do I update this libraries for ruby on a Mac, without ending up with
two different copies of ruby.
Unless you can provide evidence to the contrary, so far it looks like
the problem is nothing to do with ruby. But you need to provide more
details of both the code you are running and the exceptions you see.
Ideally, you should shrink the problem down to the smallest possible
program you can which replicates the problem, e.g.
require ‘rubygems’
require ‘some_strange_gem’
puts ruby_ode
Regards,
Brian.