chuckremes/ffi-rzmq — Issue #42: Can't run specs on Lion? mach-o, but wrong architecture
Author: gaiottino
Created: 2011-10-12 17:52:49+00:00
State: open

I initially tried to run the examples from learn-ruby-zeromq which failed so I cloned ffi-rzmq and tried to get the specs running. In both instances I can the following error.

```
bumblebee:~/Documents/src/ffi-rzmq$ rake spec
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
/Users/daniel/.rvm/rubies/jruby-1.6.4/bin/jruby -S rspec ./spec/context_spec.rb ./spec/device_spec.rb ./spec/message_spec.rb ./spec/multipart_spec.rb ./spec/nonblocking_recv_spec.rb ./spec/poll_spec.rb ./spec/pushpull_spec.rb ./spec/reqrep_spec.rb ./spec/socket_spec.rb
LoadError: Could not open library '/Users/daniel/Documents/src/ffi-rzmq/lib/ffi-rzmq/../../ext/libzmq.dylib' : dlopen(/Users/daniel/Documents/src/ffi-rzmq/lib/ffi-rzmq/../../ext/libzmq.dylib, 5): image not found. Could not open library '/usr/local/lib/libzmq.dylib' : dlopen(/usr/local/lib/libzmq.dylib, 5): no suitable image found. Did find:
/usr/local/lib/libzmq.dylib: mach-o, but wrong architecture. Could not open library '/opt/local/lib/libzmq.dylib' : dlopen(/opt/local/lib/libzmq.dylib, 5): image not found. Could not open library '/usr/local/homebrew/lib/libzmq.dylib' : dlopen(/usr/local/homebrew/lib/libzmq.dylib, 5): image not found. Could not open library 'libzmq' : dlopen(libzmq, 5): image not found. Could not open library 'libzmq.dylib' : dlopen(libzmq.dylib, 5): no suitable image found. Did find:
/usr/local/lib/libzmq.dylib: mach-o, but wrong architecture
ffi_lib at /Users/daniel/.rvm/rubies/jruby-1.6.4/lib/ruby/site_ruby/shared/ffi/library.rb:82
collect at org/jruby/RubyArray.java:2344
ffi_lib at /Users/daniel/.rvm/rubies/jruby-1.6.4/lib/ruby/site_ruby/shared/ffi/library.rb:64
LibZMQ at /Users/daniel/Documents/src/ffi-rzmq/lib/ffi-rzmq/libzmq.rb:12
(root) at /Users/daniel/Documents/src/ffi-rzmq/lib/ffi-rzmq/libzmq.rb:5
require at org/jruby/RubyKernel.java:1047
require at /Users/daniel/.rvm/rubies/jruby-1.6.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
(root) at /Users/daniel/Documents/src/ffi-rzmq/lib/ffi-rzmq/libzmq.rb:74
each at org/jruby/RubyArray.java:1603
(root) at /Users/daniel/Documents/src/ffi-rzmq/lib/ffi-rzmq.rb:73
require at org/jruby/RubyKernel.java:1047
require at /Users/daniel/.rvm/rubies/jruby-1.6.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
(root) at /Users/daniel/Documents/src/ffi-rzmq/lib/ffi-rzmq.rb:5
require at org/jruby/RubyKernel.java:1047
require at /Users/daniel/.rvm/rubies/jruby-1.6.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
(root) at /Users/daniel/Documents/src/ffi-rzmq/spec/spec_helper.rb:3
load at org/jruby/RubyKernel.java:1073
load_spec_files at /Users/daniel/Documents/src/ffi-rzmq/spec/context_spec.rb:419
collect at org/jruby/RubyArray.java:2344
load_spec_files at /Users/daniel/.rvm/gems/jruby-1.6.4@zeromq/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419
run at /Users/daniel/.rvm/gems/jruby-1.6.4@zeromq/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18
run_in_process at /Users/daniel/.rvm/gems/jruby-1.6.4@zeromq/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80
run at /Users/daniel/.rvm/gems/jruby-1.6.4@zeromq/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69
autorun at /Users/daniel/.rvm/gems/jruby-1.6.4@zeromq/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11
org.jruby.exceptions.RaiseException: (SystemExit) exit
rake aborted!
ruby -S rspec ./spec/context_spec.rb ./spec/device_spec.rb ./spec/message_spec.rb ./spec/multipart_spec.rb ./spec/nonblocking_recv_spec.rb ./spec/poll_spec.rb ./spec/pushpull_spec.rb ./spec/reqrep_spec.rb ./spec/socket_spec.rb failed

Tasks: TOP => spec
(See full trace by running task with --trace)
```

I've installed ZeroMQ using Homebrew and the version is 2.1.10. As you can see from the trace I'm trying to run it with JRuby 1.6.4 installed with RVM.

The installed lib seems ok?
```
bumblebee:~/Documents/src/ffi-rzmq$ lipo -info /usr/local/lib/libzmq.dylib
Non-fat file: /usr/local/lib/libzmq.dylib is architecture: x86_64
```

Appreciate any help to get me up and running. Thanks.