読者です 読者をやめる 読者になる 読者になる

01に向けてインストール

MacBook Airが到着したのでRabbitのインストールを試みる。

% sudo gem install rabbit

として、何回か足りないライブラリがあると怒られMacPortで追加し、無事インストール完了

% rabbit -v
2.0.6

そして起動を試みる。

% rabbit blue-circle.rd                                     
/usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/utils.rb:360:in `screen_width': undefined method `width' for nil:NilClass (NoMethodError)
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/utils.rb:376:in `screen_x_resolution'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/drawing-area-primitive.rb:111:in `init_dpi'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/base.rb:67:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/hook-handler.rb:6:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/base.rb:13:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/cursor.rb:8:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/drawing-area-primitive.rb:20:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/graffiti.rb:19:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/mask.rb:10:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/progress.rb:19:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/search.rb:8:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/gesture.rb:8:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/key-handler.rb:10:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/button-handler.rb:10:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/scroll-handler.rb:8:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/info.rb:8:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/spotlight.rb:6:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/magnifier.rb:6:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display/drawing-area-base.rb:38:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display.rb:32:in `new'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/renderer/display.rb:32:in `new'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/canvas.rb:156:in `initialize'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/command/rabbit.rb:623:in `new'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/command/rabbit.rb:623:in `make_canvas'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/command/rabbit.rb:841:in `do_display'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/command/rabbit.rb:59:in `run'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/lib/rabbit/command/rabbit.rb:30:in `run'
	from /usr/local/lib/ruby/gems/1.9.1/gems/rabbit-2.0.6/bin/rabbit:22:in `<top (required)>'
	from /usr/local/bin/rabbit:23:in `load'
	from /usr/local/bin/rabbit:23:in `<main>'

ありゃ、エラー。
調べてみると、Gdk::Screen.defaultがnilになっているのが原因も模様。
うーん。
しばらく悩んだ結果X11入ってないことに気づく。
今はXQuartzってのがあるんだね。
http://xquartz.macosforge.org/landing/
これをインストールして無事起動!