ruby-serialport
ruby-serialport copied to clipboard
MacRuby Incompatibility
Fire up macirb and attempt to load serialport fails.
$ macirb
irb(main):001:0> require 'rubygems'
=> true
irb(main):003:0> require 'serialport'
LoadError: no such file to load -- serialport.so
Change line in /lib/serialport.rb from require 'serialport.so' to require 'serialport.bundle' and try again.
$ macirb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'serialport'
=> true
irb(main):003:0> sp = SerialPort.new "/dev/cu.usbserial-A700eGAF", 115200
dyld: lazy symbol binding failed: Symbol not found: _MakeOpenFile
Referenced from: /Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/serialport-1.0.4/lib/serialport.bundle
Expected in: flat namespace
dyld: Symbol not found: _MakeOpenFile
Referenced from: /Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/serialport-1.0.4/lib/serialport.bundle
Expected in: flat namespace
Trace/BPT trap: 5
We get a little father along, but I still can't use the gem.
Yes. Referencing .so or .bundle is a no no. I have not used or tested under MacRuby, but I've been debating removing the rubygems requirement.
Do you think that removing the rubygems requirement fix the problem I'm having?
I'm not sure. It may be a side effect, as some engineers believe you should build gems without explicitly using all ruby gems as a dependency and it seems the error is coming from gems.
The fact that it's not finding a symbol (MakeOpenFile) may mean that you are missing libraries, or have architecture mismatches. What's stranger is MakeOpenFile is a low level function, so I'm thinking there may be something wrong with your installation.
Just a note, I ran into this too with the nightly of MacRuby and latest serialport.
is this still a problem now? can anybody test it?
@hparra : perhaps it can be closed now?
Probably not, as it still exists, though I'm not sure how many ppl are using MacRuby. Since I never used it myself I never experienced this bug.