ググるとHomebrewの例ばっかりでうんざりするわりにうまくいくと満足して忘れるのでメモ。
with-libyaml-dirは/opt/local/libかとおもいきやもう一個上の階層で良かった模様。portで入れるものは他にもあるかも。
% sudo port install libyaml % RUBY_CONFIGURE_OPTS="--with-libyaml-dir=/opt/local --disable-install-doc" rbenv install 3.2.2
Homebrewだと昔からmikutterのGUIの挙動がおかしくて使い物にならないのでMacports派なんですけど、M1 macではMacPortsにくわえてXQuartzとgtk3 gemをインストールした環境で、いまだにmikutterというかruby-gnomeをまともに動かすことができず、たいへんに悩んでおります。私物Macが永遠にARM Macに移行できん。
require 'gtk3' window = Gtk::Window.new window.set_size_request(400, 300) hbox = Gtk::Box.new(:vertical, 0) input = Gtk::Entry.new() hbox.pack_start(input, padding: 0) window.add(hbox) window.show_all window.signal_connect("destroy") { Gtk.main_quit } Gtk.main
上記コードを実行して、入力ボックスに文字入力しようとすると爆散します。ペーストはできるので、文字表示というよりも文字入力の処理関連のようですが、原因の切り分けが私には難しい……。
% ruby bb.rb dbus[42881]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded! (bb.rb:42881): Gdk-ERROR **: 00:31:27.198: The program 'bb.rb' received an X Window System error. This probably reflects a bug in the program. The error was 'BadLength (poly request too large or internal Xlib length erro'. (Details: serial 292 error_code 16 request_code 72 (core protocol) minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the GDK_SYNCHRONIZE environment variable to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) zsh: trace trap ruby bb.rb
ヒン……