Is it possible to get a pure aqua TK running through Ruby on Mac OS X?
Can anyone point me to the steps?
James Edward Gray II
Is it possible to get a pure aqua TK running through Ruby on Mac OS X?
Can anyone point me to the steps?
James Edward Gray II
http://developer.imendio.com/wiki/Gtk_Mac_OS_X
Was (apparently) recently merged with Gnome CVS, so should presumably be quite usable, though I'm not able to vouch for it. Build instructions are linked from the page.
Hope that helps,
matthew smillie.
On Nov 24, 2005, at 19:52, James Edward Gray II wrote:
Is it possible to get a pure aqua TK running through Ruby on Mac OS X?
Can anyone point me to the steps?James Edward Gray II
James Edward Gray II wrote:
Is it possible to get a pure aqua TK running through Ruby on Mac OS X?
Can anyone point me to the steps?James Edward Gray II
There is that page which helped me when I explored Tk with Perl or Ruby:
<http://tcltkaqua.sourceforge.net/>
J-P
If you use the apple installed ruby its all of
require 'tk' # Aqua GUI -- done
This may even work with a ruby installed from source, because I believe the
magic is actually in the Tcl/Tk libs, not ruby.
On 11/24/05, James Edward Gray II <james@grayproductions.net> wrote:
Is it possible to get a pure aqua TK running through Ruby on Mac OS X?
Can anyone point me to the steps?James Edward Gray II
James, if you do get this working with non-apple install ruby...
please post the complete steps you took to do it. Seeing as the first
thing I did with my mac is hose apple's installs of most everything,
I'd love to know how to get Tk setup so I can join in on the RRobots
fun
Of course, I'll be back at school later today where it will 'just
work' on Gentoo.
On 11/24/05, James Edward Gray II <james@grayproductions.net> wrote:
Is it possible to get a pure aqua TK running through Ruby on Mac OS X?
Can anyone point me to the steps?
If you use the apple installed ruby its all of
require 'tk' # Aqua GUI -- done
If you have X11 installed. I have this working now. Thanks.
This may even work with a ruby installed from source, because I believe the
magic is actually in the Tcl/Tk libs, not ruby.
I can't get my custom compiled Ruby to do the same. I'm seeing:
$ ruby -r tk -e1
/usr/local/lib/ruby/1.8/tk.rb:7:in `require': No such file to load -- tcltklib (LoadError)
from /usr/local/lib/ruby/1.8/tk.rb:7
If anyone knows what I'm doing wrong there, please let me know.
James Edward Gray II
On Nov 25, 2005, at 10:03 AM, Logan Capaldo wrote:
tcltklib is the part that requires tcltk iirc.
Perhaps the extconf did not find the tk libraries when you were compiling ruby?
hth
Michal
On 11/25/05, James Edward Gray II <james@grayproductions.net> wrote:
On Nov 25, 2005, at 10:03 AM, Logan Capaldo wrote:
> If you use the apple installed ruby its all of
> require 'tk' # Aqua GUI -- doneIf you have X11 installed. I have this working now. Thanks.
> This may even work with a ruby installed from source, because I
> believe the
> magic is actually in the Tcl/Tk libs, not ruby.I can't get my custom compiled Ruby to do the same. I'm seeing:
$ ruby -r tk -e1
/usr/local/lib/ruby/1.8/tk.rb:7:in `require': No such file to load --
tcltklib (LoadError)
from /usr/local/lib/ruby/1.8/tk.rb:7If anyone knows what I'm doing wrong there, please let me know.
--
Support the freedom of music!
Maybe it's a weird genre .. but weird is *not* illegal.
Maybe next time they will send a special forces commando
to your picnic .. because they think you are weird.
www.music-versus-guns.org http://en.policejnistat.cz
I got closer using the directions at the top of this page:
Now I see:
$ ruby -r tk -e1
/usr/local/lib/ruby/1.8/tk/event.rb:397: undefined method `_define_attribute_aliases' for CallbackSubst:Class (NoMethodError)
from /usr/local/lib/ruby/1.8/tk.rb:804
Does that make sense to anyone?
Note that this step of the install:
cd /usr/local/bin
/Developer/Tools/Rez -t APPL Carbon.r -o ruby
failed:
$ /Developer/Tools/Rez -t APPL Carbon.r -o ruby
### /Developer/Tools/Rez - SysError -5000 during create of "ruby".
### /Developer/Tools/Rez - Fatal error trying to open the resource file "ruby" for writing.
Fatal Error!
### /Developer/Tools/Rez - Fatal Error, can't recover.
### /Developer/Tools/Rez - Since errors occurred, ruby's resource fork was not written.
I don't think that's the error I am seeing above though.
Any tips appreciated.
James Edward Gray II
On Nov 25, 2005, at 10:32 AM, Michal Suchanek wrote:
I can't get my custom compiled Ruby to do the same. I'm seeing:
$ ruby -r tk -e1
/usr/local/lib/ruby/1.8/tk.rb:7:in `require': No such file to load --
tcltklib (LoadError)
from /usr/local/lib/ruby/1.8/tk.rb:7If anyone knows what I'm doing wrong there, please let me know.
tcltklib is the part that requires tcltk iirc.
Perhaps the extconf did not find the tk libraries when you were compiling ruby?
I tried the following on my Powerbook, 10.4.3. I believe that I have run the patch and rebuild thingy you need to do to get gem / rails to work.
require 'tk'
root = TkRoot.new() { title "Hello, world!" }
Tk.mainloop()
This works, ie pops up a window, from both the normal Terminal.app and from xterm under X11.
Message-ID: <C5B03036-D69A-4CFE-B1ED-8EBA205A2DEA@grayproductions.net>
$ ruby -r tk -e1
/usr/local/lib/ruby/1.8/tk/event.rb:397: undefined method
`_define_attribute_aliases' for CallbackSubst:Class (NoMethodError)
from /usr/local/lib/ruby/1.8/tk.rb:804
It loads older version of 'tkutil.so'.
Please check it based on 'tkutil.c' included in the same source
archive of the 'event.rb'.
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Sat, 26 Nov 2005 01:50:23 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
Hmm, I assume that means the --enable-mac-tcltk-framework option doesn't correctly point Ruby at Tiger's magic TK library. I have no idea what I would need to edit for that though...
James Edward Gray II
On Nov 25, 2005, at 9:23 PM, Hidetoshi NAGAI wrote:
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Sat, 26 Nov 2005 01:50:23 +0900
Message-ID: <C5B03036-D69A-4CFE-B1ED-8EBA205A2DEA@grayproductions.net>$ ruby -r tk -e1
/usr/local/lib/ruby/1.8/tk/event.rb:397: undefined method
`_define_attribute_aliases' for CallbackSubst:Class (NoMethodError)
from /usr/local/lib/ruby/1.8/tk.rb:804It loads older version of 'tkutil.so'.
Please check it based on 'tkutil.c' included in the same source
archive of the 'event.rb'.
Message-ID: <C4A8F3F5-1874-41C0-900E-5EE25A034CA3@grayproductions.net>
Hmm, I assume that means the --enable-mac-tcltk-framework option
doesn't correctly point Ruby at Tiger's magic TK library.
'tkutil.c' does NOT depend on Tcl/Tk libraries.
Even if there are no Tcl/Tk libraries or header files in your
environment, 'tkutil.so' can be created from it.
# On the latest version of Ruby's source archive, when fail to
# compile tcltklib, tkuti.so will not be compiled.
# Because Ruby/Tk doesn't work without tcltklib.so.
Maybe, threre is an old tkutil.so which has higher priority
on the load path, or a newer tkutil.so is not installed because
you fail to compile tkutil.c.
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Sat, 26 Nov 2005 13:15:01 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
And this compile would have happened as a natural part of Ruby's build process?
If tkutil.so is supposed to be in Ruby's lib directories, it's not there. Is there another place I should be looking for it?
What could cause it not to build?
Thanks for all your help.
James Edward Gray II
On Nov 26, 2005, at 12:23 AM, Hidetoshi NAGAI wrote:
Maybe, threre is an old tkutil.so which has higher priority
on the load path, or a newer tkutil.so is not installed because
you fail to compile tkutil.c.
Message-ID: <01A0C547-E567-4E19-BE17-3BE0759995A2@grayproductions.net>
If tkutil.so is supposed to be in Ruby's lib directories, it's not
there. Is there another place I should be looking for it?
I don't know the directory name of Ruby's dynamic library on MacOS X.
But the directory is a sub-directory of the Ruby's library directory.
For example, in my env, that is "/usr/local/lib/ruby/1.8/i686-linux".
What could cause it not to build?
If your source archive doesn't include "ext/tcltklib/" directory,
probably, you fail to compile tcltklib.so (maybe, fail to find
Tcl/Tk header files or libraries).
When cannot make tcltklib.so, tkutil.c is not compiled.
# Which sourse archive do you use?
# Old version of archive (e.g. ruby-1.8.2) doesn't support
# tcltk-framework of the latest MacOS X.
# ruby-1.8.3 or later will support it.
If your source archive includes both of "ext/tcltklib/" and "ext/tk/",
tkutil.c should be compiled.
If not, I'm sorry but I don't know the reason too.
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Sun, 27 Nov 2005 01:09:28 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Sun, 27 Nov 2005 01:09:28 +0900
Message-ID: <01A0C547-E567-4E19-BE17-3BE0759995A2@grayproductions.net>If tkutil.so is supposed to be in Ruby's lib directories, it's not
there. Is there another place I should be looking for it?I don't know the directory name of Ruby's dynamic library on MacOS X.
But the directory is a sub-directory of the Ruby's library directory.
For example, in my env, that is "/usr/local/lib/ruby/1.8/i686-linux".
You led me right to it:
Neo:~$ ruby -e 'p $:'
["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/site_ruby/1.8/powerpc-darwin8.3.0", "/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0", "."]
Neo:~$ ls /usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/t*
/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/tcltklib.bundle
/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/tkutil.bundle
# Which sourse archive do you use?
# Old version of archive (e.g. ruby-1.8.2) doesn't support
# tcltk-framework of the latest MacOS X.
This sounds like my problem right here. 1.8.3 caused me headaches, so I'm back to 1.8.2. That's the source I used.
I have TK working in the Apple install (/usr/bin/ruby), so I guess it's not too big of a deal. I was just trying to get it to work with my install, if possible.
Thanks again for trying to help.
James Edward Gray II
On Nov 26, 2005, at 10:40 AM, Hidetoshi NAGAI wrote:
Message-ID: <248A7B57-9D17-4D46-AA09-AFF2769581FC@grayproductions.net>
Neo:~$ ruby -e 'p $:'
["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/site_ruby/
1.8/powerpc-darwin8.3.0", "/usr/local/lib/ruby/site_ruby", "/usr/
local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0", "."]
Neo:~$ ls /usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/t*
/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/tcltklib.bundle
/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/tkutil.bundle
Hmm... Don't you have tkutil.* in
"/usr/local/lib/ruby/site_ruby/1.8/powerpc-darwin8.3.0" ?
^^^^^^^^^
If don't, that is very strange.
The situation shows me that tkutil.c cannot be compiled but
tk libraries are installed.
In normal case, when fail to compile tkutil.c, tk libraries
are not installed.
I don't understand what is happen in your environment.
Can 'ext/tcltklib/README.1st' ('ext/tk/README.tcltklib' on
ruby-1.8.4 or 1.9) help you?
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Sun, 27 Nov 2005 03:28:18 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Sun, 27 Nov 2005 03:28:18 +0900
Message-ID: <248A7B57-9D17-4D46-AA09-AFF2769581FC@grayproductions.net>Neo:~$ ruby -e 'p $:'
["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/site_ruby/
1.8/powerpc-darwin8.3.0", "/usr/local/lib/ruby/site_ruby", "/usr/
local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0", "."]
Neo:~$ ls /usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/t*
/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/tcltklib.bundle
/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/tkutil.bundleHmm... Don't you have tkutil.* in
"/usr/local/lib/ruby/site_ruby/1.8/powerpc-darwin8.3.0" ?
^^^^^^^^^
If don't, that is very strange.
No, that directory appears to bee empty.
It's also empty for Apple's install though, where TK is working.
I don't understand what is happen in your environment.
Can 'ext/tcltklib/README.1st' ('ext/tk/README.tcltklib' on
ruby-1.8.4 or 1.9) help you?
I read those and tried building Ruby 1.8.2 with:
./configure --enable-pthread --with-tcllib=tcl8.4 --with-tklib=tk8.4 --with-tcl-dir=/usr --with-tk-dir=/usr --with-tcltk-framework=/System/Library/Frameworks --with-tcl-framework-header=/System/Library/Frameworks/Tcl.framework/Headers/ --with-tk-framework-header=/System/Library/Frameworks/Tk.framework/Headers/
I'm still seeing errors:
/usr/local/lib/ruby/1.8/tk/event.rb:397: undefined method `_define_attribute_aliases' for CallbackSubst:Class (NoMethodError)
from /usr/local/lib/ruby/1.8/tk.rb:804
from rrobots.rb:106:in `require'
from rrobots.rb:106
James Edward Gray II
On Nov 26, 2005, at 7:30 PM, Hidetoshi NAGAI wrote:
Message-ID: <31629708-A2A2-4F52-B78E-E99B1176F665@grayproductions.net>
I read those and tried building Ruby 1.8.2 with:
./configure --enable-pthread --with-tcllib=tcl8.4 --with-tklib=tk8.4
--with-tcl-dir=/usr --with-tk-dir=/usr --with-tcltk-framework=/System/
Library/Frameworks --with-tcl-framework-header=/System/Library/
Frameworks/Tcl.framework/Headers/ --with-tk-framework-header=/System/
Library/Frameworks/Tk.framework/Headers/I'm still seeing errors:
/usr/local/lib/ruby/1.8/tk/event.rb:397: undefined method
`_define_attribute_aliases' for CallbackSubst:Class (NoMethodError)
from /usr/local/lib/ruby/1.8/tk.rb:804
from rrobots.rb:106:in `require'
from rrobots.rb:106
The change about _define_attribute_aliases was done at
'Mon Jun 13 17:07:25 2005 UTC'.
# TkUtil::RELEASE_DATE was updated at 'Tue Jun 14 11:48:48 2005 UTC'.
Please check the RELEASE_DATEs by
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Mon, 28 Nov 2005 01:40:04 +0900
---------------------------------------------------------------
/usr/local/bin/ruby -r tk -e 'p TclTkLib::RELEASE_DATE; p Tk::RELEASE_DATE; p TkUtil::RELEASE_DATE'
---------------------------------------------------------------
Of course, those RELEASE_DATE are not same.
But, probably, Tk's RELEASE_DATE will be after June 14th, and
TkUtil's RELEASE_DATE will be before June 13th.
If that is right, two or more sources or binaries are mixed in
your environment.
To clean your source environment, please rename (or remove) your
current ruby's source directory (and if you can, rename
/usr/local/lib/ruby and check that your ruby doesn't work), and
try to extract a new source directory from the new source archive,
and make and make install on the new source directory.
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
Message-ID: <31629708-A2A2-4F52-B78E-E99B1176F665@grayproductions.net>
> I don't understand what is happen in your environment.
> Can 'ext/tcltklib/README.1st' ('ext/tk/README.tcltklib' on
> ruby-1.8.4 or 1.9) help you?I read those and tried building Ruby 1.8.2 with:
./configure --enable-pthread --with-tcllib=tcl8.4 --with-tklib=tk8.4
--with-tcl-dir=/usr --with-tk-dir=/usr --with-tcltk-framework=/System/
Library/Frameworks --with-tcl-framework-header=/System/Library/
Frameworks/Tcl.framework/Headers/ --with-tk-framework-header=/System/
Library/Frameworks/Tk.framework/Headers/
Oh! tcltklib on 1.8.2 doesn't support many of those configure options.
Those were added at 'May 23 07:27:37 2005 UTC'.
If you want to make 1.8.2 on MacOS X Tiger, you have to edit
'ext/tcltklib/extconf.rb'.
If you have 'ext/tk/README.tcltklib', your 1.8.2 source tree is NOT pure.
The file was added to ruby_1_8 branch at 'Nov 2 11:19:28 2005 UTC',
or to ruby 1.9 at 'Jan 25 14:31:44 2005 UTC'.
From: James Edward Gray II <james@grayproductions.net>
Subject: Re: Mac OS X TK
Date: Mon, 28 Nov 2005 01:40:04 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
The change about _define_attribute_aliases was done at
'Mon Jun 13 17:07:25 2005 UTC'.# TkUtil::RELEASE_DATE was updated at 'Tue Jun 14 11:48:48 2005 UTC'.
Please check the RELEASE_DATEs by
---------------------------------------------------------------
/usr/local/bin/ruby -r tk -e 'p TclTkLib::RELEASE_DATE; p Tk::RELEASE_DATE; p TkUtil::RELEASE_DATE'
---------------------------------------------------------------
$ /usr/local/bin/ruby -r tk -e 'p TclTkLib::RELEASE_DATE; p Tk::RELEASE_DATE; p TkUtil::RELEASE_DATE'
/usr/local/lib/ruby/1.8/tk/event.rb:397: undefined method `_define_attribute_aliases' for CallbackSubst:Class (NoMethodError)
from /usr/local/lib/ruby/1.8/tk.rb:804
If that is right, two or more sources or binaries are mixed in
your environment.
I pull a fresh copy of the Ruby source whenever I try to build. I have however upgraded to 1.8.3 and 1.8.4pr1, then downgraded back to 1.8.2. Could my library directories be messed up by this process? Is there an easy way to uninstall ruby, so I can try a fresh build?
James Edward Gray II
On Nov 27, 2005, at 4:29 PM, Hidetoshi NAGAI wrote: