From: Eric Christopherson on
On Wed, Feb 17, 2010 at 5:40 PM, Roger Pack <rogerpack2005(a)gmail.com> wrote:
>> Luis, is it possible at all to *add* Tk bindings to a copy of Ruby
>> that has already been installed via RubyInstaller?
>
> Funny you ask.
>
> http://wiki.github.com/rdp/ruby_tutorials_core/tk
>
> has some info on it (I've had success installing tk_as_gem for 1.9.1
> mingw).

Wow, nice! Only... how do I compile the extension to take its Tcl/Tk
files from a non-default directory? I tried:
gem install tk_as_gem -- --with-tcl-dir='C:/Documents and
Settings/echristopherson/My Documents/Development/Tcl'
--with-tk-dir='C:/Documents and Settings/echristopherson/My
Documents/Development/Tcl'

(I don't have permission to install in C:\.)

From: Roger Pack on
> Wow, nice! Only... how do I compile the extension to take its Tcl/Tk
> files from a non-default directory? I tried:
> gem install tk_as_gem -- --with-tcl-dir='C:/Documents and
> Settings/echristopherson/My Documents/Development/Tcl'
> --with-tk-dir='C:/Documents and Settings/echristopherson/My
> Documents/Development/Tcl'

Did you add the bin dir into your path?
-r
--
Posted via http://www.ruby-forum.com/.

From: Alex DeCaria on
Roger Pack wrote:
>> Luis, is it possible at all to *add* Tk bindings to a copy of Ruby
>> that has already been installed via RubyInstaller?
>
> Funny you ask.
>
> http://wiki.github.com/rdp/ruby_tutorials_core/tk
>
> has some info on it (I've had success installing tk_as_gem for 1.9.1
> mingw).
>
> -rp

I tried: 'gem install tk_as_gem' but get the error message

'ERROR: Error installing tk_as_gem:
ERROR: Failed to build native extension.'

Any idea what may be wrong? I have both Tcl and Ruby 1.9 installed on
my C: drive.

--Alex
--
Posted via http://www.ruby-forum.com/.

From: Roger Pack on

> 'ERROR: Error installing tk_as_gem:
> ERROR: Failed to build native extension.'
>
> Any idea what may be wrong? I have both Tcl and Ruby 1.9 installed on
> my C: drive.

My first guess is that you don't have the devkit installed (if gcc
--version works then you do, though). We'll probably need more info,
like put your mkmf.log output into a pastie and post the link back here
or what not.
GL!
-r
--
Posted via http://www.ruby-forum.com/.

From: Eric Christopherson on
On Wed, Feb 17, 2010 at 6:14 PM, Roger Pack <rogerpack2005(a)gmail.com> wrote:
>> Wow, nice! Only... how do I compile the extension to take its Tcl/Tk
>> files from a non-default directory? I tried:
>> gem install tk_as_gem -- --with-tcl-dir='C:/Documents and
>> Settings/echristopherson/My Documents/Development/Tcl'
>> --with-tk-dir='C:/Documents and Settings/echristopherson/My
>> Documents/Development/Tcl'
>
> Did you add the bin dir into your path?

Yes. Still no luck. I also tried using both MSys and cmd.exe. This was
on my work computer.

At home, I tried installing the gem from MSys and it seemed to hang
for 30 minutes or more, so I ran gem install with --verbose the second
time. It seems to be sitting there doing nothing at a few different
spots, but the really long one (which never terminates that I can see)
is after it runs /bin/install on a whole bunch of files, with the last
one being ./lib/tkextlib/SUPPORT_STATUS.

At that point, I got the message "Updating class cache with 496
classes...". After waiting about 20 minutes for that the first time, I
decided to try running gem install with --no-ri and
--no-update-sources, but it still hangs.

Places where it hangs:
1. Right after the line
"c:/Ruby/lib/ruby/gems/1.9.1/gems/tk_as_gem-0.0.1/ext/lib/tkextlib/tkimg/window.rb".
This takes about 10 minutes here, before it actually prints out the
remaining 42 or so files unpacked, and configures and compiles the
extension.
2. Right after the line "/bin/install -c -m 644
/lib/tkextlib/SUPPORT_STATUS
c:/Ruby/lib/ruby/gems/1.9.1/gems/tk_as_gem-0.0.1/lib/tkextlib". This
is the one that seems to hang for 40 minutes, or however long I let it
go on.

After I kill the process, I am able to at least run a test Tk program.

While we're on the subject, gem install --verbose lists the files that
it's unpacking, and part of the output is the following:

(begin)
c:/Ruby/lib/ruby/gems/1.9.1/gems/tk_as_gem-0.0.1/ext/lib/tk/clipboard.rb

:/Ruby/lib/ruby/gems/1.9.1/gems/tk_as_gem-0.0.1/ext/lib/tk/clock.rb
(end)

-- notice that there is a blank line between clipboard.rb and
clock.rb, and the clock.rb line starts with :/ instead of c:/. Does
anyone know why that would be? It seems to always happen right between
those two lines.