Ruby 1.8.7 + Tk8.5 with Windows-RubyInstaller

Hi,

below you will find what I wrote down about how I got the “new”
Windows-RubyInstaller with Ruby 1.8.7 + TK8.5 working.

Please feel free to post any comments, corrections, suggestions, …

A German version follows at the bottom.

Hope it helps somebody,
Axel


= How I installed and compiled the new Windows-RubyInstaller with
Ruby 1.8.7 and TK8.5

== Requirements

  • Important: Use only paths without spaces/blanks
  • Internet connection (fast one preferred)
  • 7-zip installed [7zi]
  • Working Ruby installation, for example in path “c:\Ruby”;
    requirements: Ruby 1.8.5 at least (mswin32 or mingw32
    implementation
    will work) – Not cygwin! [rdk]
  • Rake 0.7.3 or greater [rdk]; I used 0.8.7.
  • Zlib extension and DLL (zlib1.dll) available in the PATH (could be
    in system32 or your Ruby bin directory) [rdk]
  • I used Windows-XP (home)
  • I had to switch of my anti-virus protection, while rake run

== Install TK8.5

== Install RubyInstaller-Sourcen + DevelopperKit + TK8.5

=== Download

  • http://wiki.github.com/oneclick/rubyinstaller

    Downloads
    download Development Kit, e.g.:
    z.B. devkit-3.4.5r3-20091110.7z

  • GitHub - oneclick/rubyinstaller: RubyInstaller for Windows - Build recipes

    on the top, click “download” save it anywhere, then
    extract the package to, e.g. c:\RubyInstaller, in a way, that
    directory structure of c:\RubyInstaller looks approximately like
    this:
    C:\RubyInstaller
    |-- config
    |-- rake
    |-- recipes
    |-- resources
    `--

  • Edit “C:\RubyInstaller\config\ruby_installer.rb”
    in order to get Ruby 1.8.7:

    Line: ~56
    old:
    :version => “1.8.6-p383”,
    new:
    :version => “1.8.7-p174”,

    Line: ~69
    old:
    ‘ruby-1.8.6-p383.tar.bz2’
    new:
    ‘ruby-1.8.7-p174.tar.bz2’

  • Extract:
    devkit-3.4.5r3-20091110.7z
    to c:\delete_later

  • Copy from c:\delete_later:
    “DevKit” and “bin”
    to the directory of the existing (“old”) Ruby-installation, e.g.
    C:\Ruby . You will be asked “…really?..”. Agree to all. When
    finished, the structure of the “old” Ruby-Directory should look
    like
    this:

      |-- bin
      |-- devkit
      |-- include
      |-- lib
      |-- share
      `-- ...
    
  • In file …/devkit/msys/1.0.11/etc/fstab replace “c:\Ruby” by the
    path of the “old” working Ruby-installation
    (In this example, it’s c:\Ruby, too.)

    (From:
    http://wiki.github.com/oneclick/rubyinstaller/development-kit)

=== Compile Ruby 1.8.7

([Ros], [Pac])

  • I had to switch of anti-virus protection, otherwise I got strange
    errors from rake.

  • Open a new shell and use always this one, because of the
    environment variables, which are going to be set. (If you start a
    new shell, you must set the environment variables again.)

  • Set environment variables as follows (they must fit exactly!)
    (The new Ruby will be in C:\RubyInstaller\sandbox\ruby18_mingw\bin

    TCL is in c:\tcl)

    set INCLUDE=c:\tcl\include;%INCLUDE%
    set LIB=C:\RubyInstaller\sandbox\ruby18_mingw\lib;c:\tcl\lib;%LIB
    %
    set LIBPATH=C:\RubyInstaller\sandbox\ruby18_mingw\lib;c:\tcl\bin;c:
    \tcl\lib;%LIBPATH%
    set PATH=C:\RubyInstaller\sandbox\ruby18_mingw\bin;c:\tcl\bin;%PATH
    %
    set RUBYPATH=C:\RubyInstaller\sandbox\ruby18_mingw

    If you use a proxy for internet connection:
    set HTTP_PROXY = http://:
    z.B.: set HTTP_PROXY = http://proxy.xyz.com:83

    Change the working directory:
    c:
    cd c:\RubyInstaller

    rake # wait about 30 minutes :slight_smile:

If rake aborts because of an error:

The following helped on my site:

  • Disable Virus protection
  • Restart computer, open shell only, no other apps
  • reinstall rake
  • One file, downloaded by rake, was corrupt; I had to delete it
    manually and restart rake

If everything finished without errors, the new Ruby, including
extensions, should work (but not TK!). The new ruby.exe is in:

C:\RubyInstaller\sandbox\ruby18_mingw\bin\

To check it:
<path_to_the_new_ruby.exe> -v

=== Compile TK

Set environment variables

BEGIN_LONG_LINE
set PATH=c:\rubyinstaller\sandbox\mingw\bin;c:\rubyinstaller\sandbox
\msys\bin;c:\rubyinstaller\sandbox\msys\usr\local\bin;%PATH%
END_LONG_LINE

From [rif]:
In the shell, change working directory:
cd C:\RubyInstaller\sandbox\ruby_1_8\ext\tk

Then:
ruby extconf.rb --with-tcl-dir=C:/Tcl --with-tk-dir=C:/Tcl
make install
cd tkutil
ruby extconf.rb
make install

Now, on my site Ruby 1.8.7 + TK8.5 was working.

For checking, you can write and run the following script:

require ‘tk’
p Tk::TK_PATCHLEVEL

this shall return “…8.5. …”.

If not: Did you run the script with the new Ruby?

== Rake

The rake tasks available:
rake check # Run tests for the interpreter in the sandbox.
rake clean # Remove any temporary products.
rake clobber # Remove any generated file.
rake compile # Compile the interpreter.
rake configure # Run the configure process for the interpreter.
rake download # Download all components.
rake extract # Extract all downloaded components.
rake install # Install the interpreter in the sandbox.
rake prepare # Prepare the freshly extracted components.

clean will remove the sandbox and clobber will remove all the
downloaded files.

The step sequence is:

download, extract, prepare, configure, compile, install, check

you will find the installed ruby in sandbox/ruby_mingw

You need to install before check, so the check process use the
sandbox
interpreter instead of the one you’re using to build it.

== Miscellaneous

== References:


German version:

= Installation/Kompilieren von neuem Windows-RubyInstaller mit Ruby
1.8.7(!) + TK8.5

== Voraussetzungen

  • Wichtig: Nur Pfade ohne Leerzeichen verwenden!
  • (schnelle) Internetverbindung
  • 7-zip installiert [7zi]
  • Lauffähige Ruby-Installation, z.B. in c:\Ruby; Anforderungen: Ruby
    1.8.5 at least (mswin32 or mingw32 implementation will work) – Not
    cygwin! [rdk]
  • Rake 0.7.3 or greater [rdk]; I used 0.8.7.
  • Zlib extension and DLL (zlib1.dll) available in the PATH (could be
    in system32 or your Ruby bin directory) [rdk]
  • Ich verwende Windows-XP
  • Während rake lief, mußte ich den Virenscanner ausschalten.

== TK8.5 installieren

== RubyInstaller-Sourcen + DevelopperKit installieren

=== Download

  • http://wiki.github.com/oneclick/rubyinstaller

    Downloads
    Development Kit downloaden:
    z.B. devkit-3.4.5r3-20091110.7z

  • GitHub - oneclick/rubyinstaller: RubyInstaller for Windows - Build recipes

    Oben Button “download” anklicken + irgendwo
    speichern und dann nach z.B. c:\RubyInstaller entpacken, und zwar
    so, daß der Inhalt von c:\RubyInstaller etwa so aussieht:
    C:\RubyInstaller
    |-- config
    |-- rake
    |-- recipes
    |-- resources
    `--

  • Editieren “C:\RubyInstaller\config\ruby_installer.rb”
    (um Ruby 1.8.7 zu bekommen):

    Zeile: ~56
    alt:
    :version => “1.8.6-p383”,
    neu:
    :version => “1.8.7-p174”,

    Zeile: ~69
    alt:
    ‘ruby-1.8.6-p383.tar.bz2’
    neu:
    ‘ruby-1.8.7-p174.tar.bz2’

  • Entpacken:
    devkit-3.4.5r3-20091110.7z
    nach c:\spaeter_loeschen

  • Aus c:\spaeter_loeschen kopieren:
    “DevKit” und “bin”
    in das Verzeichnis der existierende Ruby-Installation, z.B. C:\Ruby
    kopieren. Beim Kopieren von “bin” wird gefragt
    “…wirklich?”; das mit “Ja, alle” bestätigen.
    Anschließend sollte das Rubyverzeichnis so aussehen:

      |-- bin
      |-- devkit
      |-- include
      |-- lib
      |-- share
      `-- ...
    
  • In der Datei …/devkit/msys/1.0.11/etc/fstab “c:\Ruby” durch
    den Pfad zur alten, lauffähigen Ruby-Installation ersetzen.
    (Ist hier auch c:\Ruby.)

    (Quelle:
    http://wiki.github.com/oneclick/rubyinstaller/development-kit)

=== Ruby 1.8.7 kompilieren

([Ros], [Pac])

  • Ich mußte den Virenscanner abschalten, sonst brachte rake
    “mysteriöse”
    Fehlermeldungen.

  • Shell öffnen und immer in dieser arbeiten, wegen den zu setzenden
    Systemvariablen! (Wenn Shell neu gestartet wird, müssen die
    Systemvariablen erneut gesetzt werden.)

  • Systemvariablen setzen (müssen genau stimmen!):
    (Das neue Ruby wird in C:\RubyInstaller\sandbox\ruby18_mingw\bin
    sein, TCL sei in c:\tcl)

    set INCLUDE=c:\tcl\include;%INCLUDE%
    set LIB=C:\RubyInstaller\sandbox\ruby18_mingw\lib;c:\tcl\lib;%LIB%
    set LIBPATH=C:\RubyInstaller\sandbox\ruby18_mingw\lib;c:\tcl\bin;c:
    \tcl\lib;%LIBPATH%
    set PATH=C:\RubyInstaller\sandbox\ruby18_mingw\bin;c:\tcl\bin;%PATH
    %
    set RUBYPATH=C:\RubyInstaller\sandbox\ruby18_mingw

    Falls Internet über Proxy:
    set HTTP_PROXY = http://:
    z.B.: set HTTP_PROXY = http://proxy.xyz.com:83

    Arbeitsverzeichnis waehlen:
    c:
    cd c:\RubyInstaller

    rake # wait about 30 minutes :slight_smile:

Wenn rake mit Fehler abbricht:

Folgende Maßnahmen haben jeweils einzeln bei mir mal geholfen:

  • Virenscanner ausschalten
  • Rechner neu gestartet, nur Shell geöffnet
  • rake neu installiert
  • Ein von rake downgeloadetes File gelöscht; war wohl fehlerhaft

Wenn alles ohne Fehler durchgelaufen ist, ist jetzt Ruby +
Erweiterungen vom RubyInstaller fertig = lauffähig (nicht jedoch
TK!).
Die neue ruby.exe befindet sich in:
C:\RubyInstaller\sandbox\ruby18_mingw\bin\

Ausprobieren:
<Pfad_zur_neuen_ruby.exe> -v

=== TK kompilieren

Systemvariable setzen

BEGINN_LANGE_ZEILE
set PATH=c:\rubyinstaller\sandbox\mingw\bin;c:\rubyinstaller\sandbox
\msys\bin;c:\rubyinstaller\sandbox\msys\usr\local\bin;%PATH%
ENDE_LANGE_ZEILE

Aus [rif]:
In der Shell, Arbeitsverzeichnis wechseln:
cd C:\RubyInstaller\sandbox\ruby_1_8\ext\tk

Dann:
ruby extconf.rb --with-tcl-dir=C:/Tcl --with-tk-dir=C:/Tcl
make install
cd tkutil
ruby extconf.rb
make install

Nun lief bei mir Ruby 1.8.7 + TK8.5.

Ausprobieren:

Skript schreiben und starten:
require ‘tk’
p Tk::TK_PATCHLEVEL

muß “…8.5. …” liefern.

Wenn nicht: Ist das Skript mit dem neuen Ruby gelaufen?

== Rake

The rake tasks available:
rake check # Run tests for the interpreter in the sandbox.
rake clean # Remove any temporary products.
rake clobber # Remove any generated file.
rake compile # Compile the interpreter.
rake configure # Run the configure process for the interpreter.
rake download # Download all components.
rake extract # Extract all downloaded components.
rake install # Install the interpreter in the sandbox.
rake prepare # Prepare the freshly extracted components.

clean will remove the sandbox and clobber will remove all the
downloaded files.

The step sequence is:

download, extract, prepare, configure, compile, install, check

you will find the installed ruby in sandbox/ruby_mingw

You need to install before check, so the check process use the
sandbox
interpreter instead of the one you’re using to build it.

== Sonstiges

== Referenzen:

Axel wrote:

Hi,

below you will find what I wrote down about how I got the “new”
Windows-RubyInstaller with Ruby 1.8.7 + TK8.5 working.

Please feel free to post any comments, corrections, suggestions, …

Suggestion: add recipes for 8.5 to the rubyinstaller builds so they can
have it by default :slight_smile:
-r

On Dec 18, 6:48 pm, Roger P. [email protected] wrote:

Axel wrote:

Hi,

below you will find what I wrote down about how I got the “new”
Windows-RubyInstaller with Ruby 1.8.7 + TK8.5 working.

Please feel free to post any comments, corrections, suggestions, …

Suggestion: add recipes for 8.5 to the rubyinstaller builds so they can
have it by default :slight_smile:

Right now there is no recipe for 1.8.7, TK 8.5 is only compatible with
1.8.7 (changes for it never backported to 1.8.6)

A recipe will be handy, but I doubt it will work.

From: Luis L. [email protected]
Subject: Re: Ruby 1.8.7 + Tk8.5 with Windows-RubyInstaller
Date: Sat, 19 Dec 2009 08:35:06 +0900
Message-ID:
[email protected]

Right now there is no recipe for 1.8.7, TK 8.5 is only compatible with
1.8.7 (changes for it never backported to 1.8.6)

Tcl/Tk8.5.x and 8.6b1 will work with Ruby 1.8.6, when Ruby’s tcltklib
is compiled with the version of Tcl/Tk libraries.
Of course, there are no methods for the new features of new Tcl/Tk.
But Tk.tk_call() method can call such new features.

You can try to use latest Ruby/Tk on your released version of Ruby.
Please replace all files under “ext/tk” directory on your Ruby source
to the files of the latest version on Ruby’s SVN, and compile it.
I think it may work with 1.8.6 and later.

If you can read Japanese text, please see
http://www.dumbo.ai.kyutech.ac.jp/~nagai/RubyTk/

Please replace all files under “ext/tk” directory on your Ruby source
to the files of the latest version on Ruby’s SVN, and compile it.

Can you tell me the first steps on how to get tk from SVN? What is the
URL of Ruby’s SVN? I never used it…

If you can read Japanese text, please seehttp://www.dumbo.ai.kyutech.ac.jp/~nagai/RubyTk/

Sadly, no chance at all to read it - the headings look so
promissing…

Axel

Ruby Core

but instead of checkout trunk, look for branches/ruby_1_8_6 or
branches/ruby_1_8

http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&lay

Thank you two times!
Axel

On Dec 19, 4:41 am, Axel [email protected] wrote:

Please replace all files under “ext/tk” directory on your Ruby source
to the files of the latest version on Ruby’s SVN, and compile it.

Can you tell me the first steps on how to get tk from SVN? What is the
URL of Ruby’s SVN? I never used it…

http://www.ruby-lang.org/en/community/ruby-core/#following-ruby

but instead of checkout trunk, look for branches/ruby_1_8_6 or
branches/ruby_1_8

If you can read Japanese text, please seehttp://www.dumbo.ai.kyutech.ac.jp/~nagai/RubyTk/

Sadly, no chance at all to read it - the headings look so
promissing…

Not perfect, but google can help:

http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http://www.dumbo.ai.kyutech.ac.jp/~nagai/RubyTk/&sl=ja&tl=en

From: Luis L. [email protected]
Subject: Re: Ruby 1.8.7 + Tk8.5 with Windows-RubyInstaller
Date: Sat, 19 Dec 2009 23:35:17 +0900
Message-ID:
[email protected]

but instead of checkout trunk, look for branches/ruby_1_8_6 or
branches/ruby_1_8

To get the latest Ruby/Tk, look for trunk (for 1.9) or
branches/ruby_1_8 (for 1.8).