G
Giles Bowkett
has anyone run into any gotchas compiling ruby-serialport on OS X? I
get the weirdest error message.
NameError: (eval):1:in `private_class_method': undefined method
`create' for class `Class'
from (eval):1
from (eval):1
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:28:in
`require'
from (irb):1
there's a .bundle file which is created when you compile, I'm guessing
that's a way to use Ruby with C. the bundle file has lots of binary
stuff in there but you can also see Ruby code, with the create
statement that Ruby's objecting to here. I'm running Ruby 1.8.6.
This is the actual Ruby code in the bundle file:
class SerialPort
private_class_methodcreate)
def SerialPort::new(port, *params)
sp = create(port)
begin
sp.set_modem_params(*params)
rescue
sp.close
raise
end
return sp
end
def SerialPort:pen(port, *params)
sp = create(port)
begin
sp.set_modem_params(*params)
if (block_given?)
yield sp
sp.close
return nil
end
rescue
sp.close
raise
end
return sp
end
end
(with indentation added.)
ruby-serialport hasn't seen active development since 2003, but all the
blogs I've found say setting it up on OS X was a piece of cake. the
Lego Mindstorms Bluetooth library ruby-nxt uses it and I've seen
people use that with no problems. (or at least, no significant
problems.) I'm totally stumped on this.
--
Giles Bowkett
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com/
get the weirdest error message.
NameError: (eval):1:in `private_class_method': undefined method
`create' for class `Class'
from (eval):1
from (eval):1
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:28:in
`require'
from (irb):1
there's a .bundle file which is created when you compile, I'm guessing
that's a way to use Ruby with C. the bundle file has lots of binary
stuff in there but you can also see Ruby code, with the create
statement that Ruby's objecting to here. I'm running Ruby 1.8.6.
This is the actual Ruby code in the bundle file:
class SerialPort
private_class_methodcreate)
def SerialPort::new(port, *params)
sp = create(port)
begin
sp.set_modem_params(*params)
rescue
sp.close
raise
end
return sp
end
def SerialPort:pen(port, *params)
sp = create(port)
begin
sp.set_modem_params(*params)
if (block_given?)
yield sp
sp.close
return nil
end
rescue
sp.close
raise
end
return sp
end
end
(with indentation added.)
ruby-serialport hasn't seen active development since 2003, but all the
blogs I've found say setting it up on OS X was a piece of cake. the
Lego Mindstorms Bluetooth library ruby-nxt uses it and I've seen
people use that with no problems. (or at least, no significant
problems.) I'm totally stumped on this.
--
Giles Bowkett
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com/