ruby-serialport icon indicating copy to clipboard operation
ruby-serialport copied to clipboard

MacRuby Incompatibility

Open jasmarc opened this issue 13 years ago • 8 comments

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.

jasmarc avatar Mar 19 '12 19:03 jasmarc

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.

hparra avatar May 26 '12 04:05 hparra

Do you think that removing the rubygems requirement fix the problem I'm having?

jasmarc avatar May 31 '12 19:05 jasmarc

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.

hparra avatar May 31 '12 19:05 hparra

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.

hparra avatar May 31 '12 19:05 hparra

Just a note, I ran into this too with the nightly of MacRuby and latest serialport.

tiegz avatar Oct 11 '12 21:10 tiegz

is this still a problem now? can anybody test it?

ghost avatar Nov 04 '13 23:11 ghost

@hparra : perhaps it can be closed now?

ghost avatar Dec 02 '13 03:12 ghost

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.

hparra avatar Dec 02 '13 10:12 hparra