I have asked a question on SuperUser about updating Ruby version in Google SketchUp. It seems that there is something different between Ruby shipped with the standard OS X distribution, and Ruby installed by RVM or MacPorts. I get the following error message when I try to use RVM's or MacPorts' Ruby 1.9.1
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Dyld Error Message:
Library not loaded: @executable_path/../Frameworks/Ruby.framework/Versions/A/Ruby
Referenced from: /Applications/Google SketchUp 7/SketchUp.app/Contents/MacOS/SketchUp
Reason: no suitable image found. Did find:
/Applications/Google SketchUp 7/SketchUp.app/Contents/MacOS/../Frameworks/Ruby.framework/Versions/A/Ruby: mach-o, but wrong architecture
/Applications/Google SketchUp 7/SketchUp.app/Contents/MacOS/../Frameworks/Ruby.framework/Versions/A/Ruby: mach-o, but wrong architecture
/usr/lib/Ruby: not a file
Model: MacBookPro7,1, BootROM MBP71.0039.B05, 2 processors, Intel Core 2 Duo, 2.4 GHz, 4 GB, SMC 1.62f5
But it works with Ruby 1.8.7 from /System/Library/Frameworks/Ruby.framework/
UPDATE1
As it was explained by Alex I need to compile Ruby with i386
architecture. One can do it for MacPorts and RVM, but none of the methods worked for me due to various errors.
- http://www.pubbs.net/201001/macports/76440-howto-force-i386-build-on-snow-leopard-macports-182.html
- http://guide.macports.org/chunked/internals.configuration-files.html
- http://rvm.beginrescueend.com/os/darwin/
So I decided to compile Ruby 1.9.2-rc2
from sources
$ ARCHFLAGS="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --with-arch=i386
$ make && sudo make install
and copy corresponding files to SketchUp
$ cd /Applications/Google\ SketchUp\ 7/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/A/
$ rm -r Headers Ruby
$ cp /usr/local/bin/ruby Ruby
$ mkdir Headers
$ cp /usr/local/include/ruby-1.9.1/i386-darwin10.4.0/ruby/config.h Headers/
$ cp /usr/local/include/ruby-1.9.1/ruby.h Headers/
$ cp -r /usr/local/include/ruby-1.9.1/ruby/* Headers/
$ ls Headers
backward/ defines.h dl.h intern.h missing.h re.h ruby.h util.h vm.h
config.h digest.h encoding.h io.h oniguruma.h regex.h st.h version.h
This time I have got the following message
Dyld Error Message:
Library not loaded: @executable_path/../Frameworks/Ruby.framework/Versions/A/Ruby
Referenced from: /Applications/Google SketchUp 7/SketchUp.app/Contents/MacOS/SketchUp
Reason: no suitable image found. Did find:
/Applications/Google SketchUp 7/SketchUp.app/Contents/MacOS/../Frameworks/Ruby.framework/Versions/A/Ruby: can't map
/Applications/Google SketchUp 7/SketchUp.app/Contents/MacOS/../Frameworks/Ruby.framework/Versions/A/Ruby: can't map
/usr/local/lib/Ruby: not a file
/usr/lib/Ruby: not a file