hparra / ruby-serialport

ruby-serialport is a Ruby library that provides a class for using RS-232 serial ports
http://rubygems.org/gems/serialport
GNU General Public License v2.0
246 stars 58 forks source link

MacRuby Incompatibility #30

Open jasmarc opened 12 years ago

jasmarc commented 12 years ago

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.

hparra commented 12 years ago

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.

jasmarc commented 12 years ago

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

hparra commented 12 years ago

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 commented 12 years ago

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.

tiegz commented 11 years ago

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

ghost commented 10 years ago

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

ghost commented 10 years ago

@hparra : perhaps it can be closed now?

hparra commented 10 years ago

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.