[追記] できるようになりました。
RubyでGUIアプリケーションを作成しようと思ってTcl/Tkを選ぶことにしたが、導入がうまく行かない。
https://bugs.ruby-lang.org/issues/8435 などに報告があるUbuntuの仕様によるもののようだが、configureを変更してもどうもうまくいかない。
とりあえず試行錯誤。
#rbenvを使っているのでそれを利用してコンパイルします
私が使っていたやつ
bash
$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/include/openssl/ --with-tcl-include=/usr/include/tcl8.5/ --with-tk-include=/usr/include/tk8.5/ --with-tcllib=tcl8.5 --with-tklib=tk8.5" rbenv install --force -v 2.1.3
ダメでした。
上記サイトの解
bash
$ --with-tclConfig-file=/usr/lib/x86_64-linux-gnu/tclConfig.sh --with-tkConfig-file=/usr/lib/x86_64-linux-gnu/tkConfig.sh
合わせてみた
bash
$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/include/openssl/ --with-tclConfig-file=/usr/lib/x86_64-linux-gnu/tcl8.5/tclConfig.sh --with-tkConfig-file=/usr/lib/x86_64-linux-gnu/tk8.5/tkConfig.sh" rbenv install --force -v 2.1.3
これもダメでした
だめもと&やけくそ
bash
$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/include/openssl/ --with-tclConfig-file=/usr/lib/x86_64-linux-gnu/tcl8.5/tclConfig.sh --with-tkConfig-file=/usr/lib/x86_64-linux-gnu/tk8.5/tkConfig.sh --with-tcllib=tcl8.5 --with-tklib=tk8.5 --enable-pthread" rbenv install --force -v 2.1.3
全部次のエラーが出ます。
configuring tk
...........
check struct members..
check libraries....
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh.....................
WARNING: found "/usr/lib/tclConfig.sh", but cannot find valid Tcl library for the tclConfig.sh. So, ignore it.
WARNING: found "/usr/lib/tkConfig.sh", but cannot find valid Tk library for the tkConfig.sh. So, ignore it.
..........
Fail to find [tclConfig.sh, tkConfig.sh]
Use X11 libraries (or use TK_XINCLUDES/TK_XLIBSW information on tkConfig.sh).
Search tcl.h..
Search tk.h..Search Tcl library...........
Search Tcl library...........
Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options.
Can't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk.
If you have Tcl/Tk libraries on your environment, you may be able to use them with configure options (see ext/tk/README.tcltklib).
At present, Tcl/Tk8.6 is not supported. Although you can try to use Tcl/Tk8.6 with configure options, it will not work correctly. I recommend you to use Tcl/Tk8.5 or 8.4.
Failed to configure tk. It will not be installed.
configuring tk/tkutil
Failed to configure tk/tkutil. It will not be installed.
うーん、Ubuntu14.04の報告も記事もないしまたアップデートでなにか変わったのかしら
諦めて当分はGtk使ってみようかなーそれかJRubyか
追記 できました
Thanks to @prusswan
はじめにこうして
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libtcl8.5.so.0 /usr/lib/libtcl8.5.so.0
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libtk8.5.so.0 /usr/lib/libtk8.5.so.0
$ sudo ln -s /usr/lib/x86_64-linux-gnu/tcl8.5/tclConfig.sh /usr/lib/tclConfig.sh
$ sudo ln -s /usr/lib/x86_64-linux-gnu/tk8.5/tkConfig.sh /usr/lib/tkConfig.sh
$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/include/openssl/ --with-tclConfig-file=/usr/lib/tclConfig.sh --with-tkConfig-file=/usr/lib/tkConfig.sh --with-tcllib=tcl8.5 --with-tklib=tk8.5 --enable-pthread" rbenv install --force -v 2.1.3
これで行けるはずです。