[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Compiling Ruby 1.9.1 zlib issue on Windows

Joel Dezenzio

6/3/2009 8:34:00 PM

Hi everyone,

I just have a strange issue and it's probably a step that I'm missing
somewhere...

I wanted to compile a windows version of 1.9.1 to include Tk so that I
would have cross-platform GUI for Ruby.

I downloaded and installed Tcl, and the latest Zlib installer. I
performed the following updates:

set INCLUDE=c:\tcl\include;c:\program files\GnuWin32\include;%INCLUDE%
set LIB=c:\ruby\lib;c:\tcl\lib;c:\program files\GnuWin32\lib;%LIB%
set LIBPATH=c:\ruby\lib;c:\tcl\bin;c:\tcl\lib;c:\program
files\GnuWin32\bin;c:\program files\GnuWin32\lib;%LIBPATH%
set PATH=c:\ruby\bin;c:\tcl\bin;c:\program files\GnuWin32\bin;%PATH%
set RUBYPATH=c:\ruby

I DC'd from my router and disabled/paused kaspersky so it wouldn't
interfere with permissions during nmake..

I moved the latest 1.9.1-p129 source into a folder called c:\rubysource

cd rubysource (and hit enter)
type vcvars32 (and hit enter)
type win32\configure.bat --prefix=c:\ruby (and hit enter)
type nmake and hit enter
type nmake DESTDIR=c:\ruby install (and hit enter)

I run ruby -v (ruby 1.9.1p129 (2009-05-12 revision 23412)
[i386-mswin32_90]
I run gem -v (1.3.1)
I run IRB.
% require 'tk'
% Tk::TK_PATCHLEVEL

.. all checks out OK .. so far so good..

I type gem update --system

C:/ruby/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:1:in 'require': no such
file to load -- zlib (LoadError)

I'm not sure what I'm doing wrong. I downloaded and installed the
latest zlib source (version 1.2.3)..

During the nmake process I even see it compiling zlib...
--
Posted via http://www.ruby-....

13 Answers

Luis Lavena

6/3/2009 9:31:00 PM

0

On Jun 3, 5:33 pm, "J. D." <jdezen...@gmail.com> wrote:
> Hi everyone,
>
> I just have a strange issue and it's probably a step that I'm missing
> somewhere...
>
> I wanted to compile a windows version of 1.9.1 to include Tk so that I
> would have cross-platform GUI for Ruby.
>
> I downloaded and installed Tcl, and the latest Zlib installer.  I
> performed the following updates:
>

The zlib file you downloaded needs to containg include headers and
linking (.lib) libraries.

Check that and that will tell you if zlib got compiled or not:

ruby -ve "require 'zlib'; puts Zlib::ZLIB_VERSION"

HTH,
--
Luis Lavena

Joel Dezenzio

6/3/2009 9:37:00 PM

0

In case someone asks, the headers for zlib are located in C:\Program
Files\GnuWin32\include (zlib and zconf)


--
Posted via http://www.ruby-....

Joel Dezenzio

6/3/2009 9:43:00 PM

0

Luis Lavena wrote:
> On Jun 3, 5:33�pm, "J. D." <jdezen...@gmail.com> wrote:
>>
> The zlib file you downloaded needs to containg include headers and
> linking (.lib) libraries.
>
> Check that and that will tell you if zlib got compiled or not:
>
> ruby -ve "require 'zlib'; puts Zlib::ZLIB_VERSION"
>
> HTH,

Says..

ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32_90] -e:1:in
'require': no such file to load -- zlib (LoadError) from -e:1:in
'<main>'

The headers are located in c:\program files\GnuWin32\include
The .lib files are located in c:\program files\GnuWin32\lib

Before compiling my environment is set to:

set INCLUDE=c:\tcl\include;c:\program files\GnuWin32\include;%INCLUDE%
set LIB=c:\ruby\lib;c:\tcl\lib;c:\program files\GnuWin32\lib;%LIB%
set LIBPATH=c:\ruby\lib;c:\tcl\bin;c:\tcl\lib;c:\program
files\GnuWin32\bin;c:\program files\GnuWin32\lib;%LIBPATH%
set PATH=c:\ruby\bin;c:\tcl\bin;c:\program files\GnuWin32\bin;%PATH%
set RUBYPATH=c:\ruby

What do I need to do to make sure they are included? I'm not following
why it's not including them. It includes tcl and I've added the
environment exactly the same way..
--
Posted via http://www.ruby-....

Joel Dezenzio

6/3/2009 10:33:00 PM

0

I fixed it Luis.

I just took the entire source for zlib and placed it into a folder
called c:\zlib and then copied installed .dll and .lib files into that
folder and changed my path to point to c:\zlib.

I recompiled and now both zlib and Tk are functioning properly.

--
Posted via http://www.ruby-....

Joel Dezenzio

6/4/2009 12:54:00 AM

0

Now I have an issue with rails and it appears to be related to iconv.so
being missing...

I went to irb and tried a require 'iconv' and it was not found. I
cannot run rails demo without getting the following error:

undefined method 'camelize' for "app":String

I'm determined to complete my own compile of 1.9.1 on windows so I'm
willing to work through the issues.

Other than what you can see that I've done above, is there something I'm
missing? Where do I get the correct iconv.so file or how do I create
it. Anything else I might be missing?

Thanks in advance..

--
Posted via http://www.ruby-....

Luis Lavena

6/4/2009 11:30:00 AM

0

On Jun 3, 9:53 pm, "J. D." <jdezen...@gmail.com> wrote:
> Now I have an issue with rails and it appears to be related to iconv.so
> being missing...
>
> I went to irb and tried a require 'iconv' and it was not found.  I
> cannot run rails demo without getting the following error:
>
> undefined method 'camelize' for "app":String
>
> I'm determined to complete my own compile of 1.9.1 on windows so I'm
> willing to work through the issues.
>
> Other than what you can see that I've done above, is there something I'm
> missing?  Where do I get the correct iconv.so file or how do I create
> it.  Anything else I might be missing?
>
> Thanks in advance..
>

Well, your doing so many things at the same time that is hard to
follow you.

One, you compiled 1.9 with Visual Studio just to get TK, where you
could have used MinGW based version from GitHub and compile just TK on
top.

MinGW based version of Ruby already have zlib and iconv solved, but is
missing Tk.

You could invest some time and get the recipe to build it for you.

Take a look to recipes folder here:

http://github.com/oneclick/rub...

Definitely you're going over a complicated road building everything
from scratch. Also, asking for help is going to be trickier since your
version of Ruby is going to be built in a complete different version
than other Ruby users.

But, again, if "you're determinated to complete your own compile of
ruby" then be my guest and steal what I did for iconv form the above
repository.

--
Luis Lavena

Joel Dezenzio

6/4/2009 2:48:00 PM

0

Thanks Luis..

I took a look at the repository and decided to play around this morning
and see how it all worked..

After git cloning locally and running a few tests:

rake (correctly builds 1.8.6)

If I run rake ruby19 CHECKOUT=1 (I receive the following error)

After the following..

nv zlib1.dll bin
cd -
cd C:/rubyinstaller (this is my local clone for the install)
svn co http://svn.ruby-lang.org/.../branches/...
downloads/ruby_1_9
rake aborted!
Command failed with status (127): [svn co
http://svn.ruby-lang.org/......]

I tried to do rake ruby19 CHECKOUT=1 TRUNK=1 (and receive the same
error)

I would definitely like to try the easier methods when doing the build.

I just wanted to do a build for myself to see the process. But, I
realize that process is "very" long and tedious. I like the way you've
setup the recipes..
--
Posted via http://www.ruby-....

Joel Dezenzio

6/4/2009 2:52:00 PM

0

Also, I forgot to add..

On my current build I have the following:

Ruby 1.9.1 => Build Solved
Tk => Build Solved
zlib => Build Solved
iconv => Not Solved
.. that's as far as I've gotten thus far ..

Check out my post above about the respository..

--
Posted via http://www.ruby-....

Luis Lavena

6/5/2009 12:20:00 AM

0

On Jun 4, 11:48 am, "J. D." <jdezen...@gmail.com> wrote:
> Thanks Luis..
>
> I took a look at the repository and decided to play around this morning
> and see how it all worked..
>
> After git cloning locally and running a few tests:
>
> rake (correctly builds 1.8.6)
>
> If I run rake ruby19 CHECKOUT=1 (I receive the following error)
>
> After the following..
>
> nv zlib1.dll bin
> cd -
> cd C:/rubyinstaller (this is my local clone for the install)
> svn cohttp://svn.ruby-lang.org/.../branches/...
> downloads/ruby_1_9
> rake aborted!
> Command failed with status (127): [svn cohttp://svn.ruby-lang.org/......]
>

Ruby source code uses Subversion, which you need to install.

I recommend getting the binaries from here:

http://subversion.t...

You could try the Collabnet versions, which are Installers and setup
the PATH for you, or you can be hardcore and download the zip one ;-)

Anyway, check if subversion is available with "svn --version"

> I tried to do rake ruby19 CHECKOUT=1 TRUNK=1 (and receive the same
> error)
>

AFAIK "TRUNK" option is only available on Roger Pack fork, not on
mine:

http://github.com/rogerdpack/rubyinstaller/t...

Both are synced, so is safe for you do the following:

git remote add roger http://github.com/rogerdpack/rubyinstaller/t...
git remote update
git checkout -b roger-master roger/master

And from there, use the exact same command you pasted above.

> I would definitely like to try the easier methods when doing the build.

What you did is good, I believe based on years being building my own
version of Ruby, this is the easiest way.

> I just wanted to do a build for myself to see the process.  But, I
> realize that process is "very" long and tedious.  I like the way you've
> setup the recipes..

Indeed, the process is very tedious and error prone. Ruby itself
bundles a lot of libraries that depend on so many external tools and
libraries that turn the joy of using RUby (the language) into a
nightmare and frustration.

You can read more about the project at my blog:

http://blog.mmed...
(shameless self-promotion)

Cheers,
--
Luis Lavena

Luis Lavena

6/5/2009 12:24:00 AM

0

On Jun 4, 11:51 am, "J. D." <jdezen...@gmail.com> wrote:
> Also, I forgot to add..
>
> On my current build I have the following:
>
> Ruby 1.9.1 => Build Solved
> Tk => Build Solved
> zlib => Build Solved
> iconv => Not Solved
> . that's as far as I've gotten thus far ..
>

And there are like 15 more, including readline :-D

> Check out my post above about the respository..
>

Done and replied.

Keep us posted on your progress.

Cheers,
--
Luis Lavena