[Rubycocoa-devel 143] Re: [0.4.2 動作確認 ] osx-10.4.2 + ruby-1.8.3 + xcode-2.0

Back to archive index

kimura wataru kimur****@i*****
Tue Nov 1 20:36:00 JST 2005


 木村です。

>藤本です。
>
>OS 10.4.2 + ruby 1.8.3 + xcode 2.0 + gcc-3.3
>の環境でテストしてみたことに関して結果をアップします。一部サンプルが動きませんでした。とりあえず報告しておきます。
>
>=== osx-10.4.2 + ruby-1.8.3
>

>動かなかった:
>  $ cd Pong && rm -rf build
>  $ xcodebuild clean build
>  $ open build/Pong.app
>      2005-10-31 20:10:23.067 Pong[4224] PlayingView(0x4f6520) - \
>        NSView not correctly initialized. Did you forget to call super? \
>        ...Resources/Model.rb:168:in `NSApplicationMain': NSApplicationMain - \
>          RBException_NoMethodError - \
>          undefined method `play' for nil:NilClass (OSX::OCException)
>   from ...Resources/rb_main.rb:18
>

Model.rbでシステムのバージョンにより効果音を決めている箇所で、
バージョンが正しく取得できていないのが原因でした。

MacOS X 10.4.2のとき、archdirの値が
* ruby-1.6: powerpc-darwin8.2
* ruby-1.8: powerpc-darwin8.2.0
となってしまうために存在しないサウンドを鳴らそうとしてエラーに
なるようです。

以下のように修正しました。

--- sample/Pong/Model.rb        18 Dec 2002 00:15:14 -0000      1.3
+++ sample/Pong/Model.rb        1 Nov 2005 11:27:08 -0000       1.4
@@ -160,7 +160,7 @@
 
   def snd_init
     require 'rbconfig'
-    if File.basename(Config::CONFIG['archdir'])[-3..-1].to_f >= 6.0 then
+    if `uname -r`.to_f >= 6.0 then
       @wall_snd = OSX::NSSound.soundNamed "Pop"
     else
       @wall_snd = OSX::NSSound.soundNamed "Bonk"



-- 
kimura wataru



More information about the Rubycocoa-devel mailing list
Back to archive index