2012-09-05 99 views
0

我試圖安裝ruby-llvm在Mac上使用32位紅寶石運行64位dylib

我可以安裝llvm與brew install llvm -shared,我也可以安裝ruby-llvmsudo gem install ruby-llvm命令。

但是,當我試圖運行examples時,我收到了這些錯誤消息。

/Users/smcho/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.1.5/lib/ffi/library.rb:121:in `block in ffi_lib': 
Could not open library '/DIR/.rvm/gems/ruby-1.9.3-p194/gems/ruby-llvm-3.0.0/lib/libRubyLLVMSupport-3.0.0.dylib': 
dlopen(/DIR/.rvm/gems/ruby-1.9.3-p194/gems/ruby-llvm-3.0.0/lib/libRubyLLVMSupport-3.0.0.dylib, 5): no suitable image found. Did find: (LoadError) 
/DIR/.rvm/gems/ruby-1.9.3-p194/gems/ruby-llvm-3.0.0/lib/libRubyLLVMSupport-3.0.0.dylib: mach-o, but wrong architecture 

我檢查了動態庫是64位。

file /DIR/.rvm/gems/ruby-1.9.3-p194/gems/ruby-llvm-3.0.0/lib/libRubyLLVMSupport-3.0.0.dylib 
libRubyLLVMSupport-3.0.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64 

而且似乎ruby運行在32位模式。 ruby 1.9.3p194 (2012-04-20 revision 35410) [i386-darwin11.4.0]

我該如何解決這個問題?有沒有辦法下載32位版本的ruby-llvm或64位版本的ruby

回答

1

看來你已經在32位模式下安裝了ruby。以64位模式安裝ruby能解決問題嗎?

要強制64位,你可以嘗試用最新版本RVM以下:

$ rvm install 1.9.3 --64 

或 $ RVM安裝1.9.3 --with拱= x86_64的

(來源:http://www.engineyard.com/blog/2012/rvm-stable-and-more/

有關OS X編譯32位模式紅寶石我們--32,--64和--universal標誌:

$ rvm install 1.9.3 --universal # to build fat binary including both 32 and 64 bit binaries 
$ rvm install 1.8.7 --32 # to build only 32 bit ruby 
$ rvm install 1.8.7 --with-arch=i386 # is equivalent to the 32 bit one, but is available only via RVM, ruby 1.8.7 sources do not support it.