Atualmente, o Google SketchUp para Mac tem a versão Ruby 1.8.5
, que acho um pouco desatualizada. Eu posso atualizar o Ruby para 1.8.7 (versão do OSX) pelos seguintes comandos
$ cd /Applications/Google\ SketchUp\ 7/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/Current
$ ls
Headers/ Resources/ Ruby
$ ls Headers/
config.h defines.h intern.h missing.h ruby.h
$ rm -r Headers
$ ln -s /System/Library/Frameworks/Ruby.framework/Headers
$ ln -fs /System/Library/Frameworks/Ruby.framework/Ruby
O SketchUp é iniciado sem problemas e o console Ruby mostra a versão 1.8.7.
1.9.2
Agora, tento ir mais longe e atualizar para 1.9.2-rc2
. O Google SketchUp exige i386
binary, que pode ser produzido pelos seguintes comandos
$ cd ~/ruby-1.9.2-rc2/
$ ARCHFLAGS="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --with-arch=i386
$ make && sudo make install
Depois copio os arquivos necessários para o SketchUp
$ cd /Applications/Google\ SketchUp\ 7/SketchUp.app/Contents/Frameworks/Ruby.framework/
$ rm 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
e quando tento iniciar o SketchUp, recebo o seguinte relatório de erros
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: 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
Model: MacBookPro7,1, BootROM MBP71.0039.B05, 2 processors, Intel Core 2 Duo, 2.4 GHz, 4 GB, SMC 1.62f5
Você poderia me dizer por quê?
UPDATE1
Dan Rathbun realizou alguns testes e encontrou o seguinte
On Win32 when I tried to get Sketchup
to load any 1.9.x I got an "Entry
point not found" for the ruby C
function "rb_set_kcode" which is no
longer in 1.9.x (it was renamed, and
the Ruby people did not alias the old
name to the new name.)
Basically Sketchup calls rb_set_kcode
to set the character encoding to UTF8
just after loading the Ruby
interpreter. It works fine for any
Ruby in the 1.8.x branch, but in 1.9.x
the Ruby project totally reengineered
the character encoding, and gave all
the C functions new identifiers, and
added alot more functions.
The solution for 1.9.x and Sketchup
seems to be that Sketchup needs to be
"Ruby Version Agile", which means a
coding change by the Google Guys in
Boulder.