LoadError: no such file to load -- tk

From: Rich L. [email protected]
Subject: Re: LoadError: no such file to load – tk
Date: Fri, 23 Jul 2010 12:36:07 +0900
Message-ID: [email protected]

I need the messages at ext/tk step of “make”.

Here’s all the output from the terminal:

Ah, I’m sorry. It may be ambiguous.

During compiling Ruby, make-process creates each library under
/ext directory (ext/tk is one of them).
Then, the process calls “miniruby extconf.rb”.

/ext/tk/extconf.rb search Tcl/Tk libraries.
And then, it outputs messages about search steps.
I need the messages.
It gives me hints about why cannot find available libraries.

Rich L. wrote:

I need to install x11-toolkits/ruby-tk. I will try now.

I have success. Thank you Hidetoshi-san. :slight_smile:

On Fri, Jul 23, 2010 at 9:42 AM, Rich L. [email protected] wrote:

Rich L. wrote:

I need to install x11-toolkits/ruby-tk. I will try now.

I have success. Thank you Hidetoshi-san. :slight_smile:

Could you write up a step-by-step set of instructions? Would be useful
for the next person.

martin

Martin DeMello wrote:

On Fri, Jul 23, 2010 at 9:42 AM, Rich L. [email protected] wrote:

Rich L. wrote:

I need to install x11-toolkits/ruby-tk. I will try now.

I have success. Thank you Hidetoshi-san. :slight_smile:

Could you write up a step-by-step set of instructions? Would be useful
for the next person.

martin

To install Ruby/Tk on FreeBSD 8.0 Unix I did these three commands to
install the three components (as root):

  1. /usr/ports/lang/tcl85# make install clean #Installs
    Tcl/tk
  2. /usr/ports/lang/ruby18# make install clean #Installs Ruby
    1.8
  3. /usr/ports/x11-toolkits/ruby-tk# make install clean #Installs Ruby
    tk “stuff” I think (extensions, libraries?).

Very easy, I just installed the three components and it worked, no
hacking required.

Hidetoshi NAGAI wrote:

From: Rich L. [email protected]
Subject: Re: LoadError: no such file to load – tk
Date: Thu, 22 Jul 2010 09:47:35 +0900
Message-ID: [email protected]

Probably, ext/tk/extconf.rb outputs some messages about searching and
testing Tcl/Tk libraries (and {tcl,tk}Config.sh) during make steps.
Please tell me the messages, too.

On a FreeBSD 8.0 machine I went to \usr\ports\lang\tcl85 and as root
ran; make install clean. This installed tcl 8.5. On command line if I

I need the messages at ext/tk step of “make”.

Previous output was from Tcl. I found something useful at the end of
Ruby install:

====
Note that some of the standard libraries are provided as separate
ports since they require extra dependencies:

converters/ruby-iconv iconv module

databases/ruby-gdbm: GDBM module

x11-toolkits/ruby-tk: Tcl/Tk modules
japanese/ruby-tk: Tcl/Tk modules for Japanized Tcl/Tk

lang/ruby-mode.el: Emacs lisp modules

Install them as occasion demands.

I need to install x11-toolkits/ruby-tk. I will try now.

I followed the guide on http://www.tkdocs.com/tutorial/install.html
and success. I use Ubuntu.

  1. change to root
    sudo -i

  2. Install ActiveTcl
    wget
    http://downloads.activestate.com/ActiveTcl/releases/8.6.0.0b7/ActiveTcl8.6.0.0b7.295590-linux-ix86-threaded.tar.gz
    tar xzf ActiveTcl8.6.0.0b7.295590-linux-ix86-threaded.tar.gz
    cd ActiveTcl8.6.0.0b7.295590-linux-ix86-threaded
    ./install.sh

  3. export PATH=$PATH:/opt/ActiveTcl-8.6
    The guide on http://www.tkdocs.com not say this.
    But this is important, unless ruby will not find tk.

  4. Install libx11-dev
    open “Ubuntu Software Centre”
    search “libx11-dev”
    install it

  5. compile ruby
    wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
    tar xzf ruby-1.9.3-p194.tar.gz
    cd ruby-1.9.3-p194
    ./configure && make && make install

now everything works

irb(main):001:0> require ‘tk’
=> true
irb(main):002:0> Tk::TK_PATCHLEVEL
=> “8.6b2”
irb(main):003:0>

Not onty sudo apt-get install tk is enough but you also need the below
library files to be installed so that your problem will be solved and
you wont see this error never again.

$ sudo apt-get install libtcltk-ruby

thanks

KK

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs