Forum: Ruby Compiling ruby from source on windows

Posted by Gianluca GPad (gpad)
on 2012-09-05 13:09
(Received via mailing list)
Hi to all,
I'm trying to compile ruby on my windows 7. I have already a ruby 
version installed (ruby 1.9.2p180).

I download the source from github:

1) Executed win32\configure.bat --> OK
2) launch nmake and this is the result:

compiling ./enc/trans/big5.c
big5.c
c1 : fatal error C1083: Cannot open source file: './enc/trans/big5.c': 
No such file or directory
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 
10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 
10.0\VC\BIN\nmake.EXE"' : return code '0x2
'
Stop.

Searching in internet I found that this error is related from the 
absence of an installed version of ruby, but I have one ?!?

Can somebody help me?

thanks
Gianluca
Posted by Roger Pack (rogerdpack)
on 2012-09-14 07:08
you already have visual studio installed?
Regardless, I would suggest using MinGW plus the ruby recipes that the 
rubyinstaller guys use...
Posted by Nathan Ahmed (Guest)
on 2012-09-14 16:58
(Received via mailing list)
Why do we need Visual Studios if we got Ruby? Is it a compiler issue? 
Will
the aforementioned method compile to .exe and .dlls (if need be)?
Posted by Gianluca GPad (gpad)
on 2012-09-17 09:05
(Received via mailing list)
Hi,
I have VS installed but the problem seems related to the generation of 
code with an installed version of ruby (that I have ...)

bye
Gianluca
Posted by Eric Christopherson (echristopherson)
on 2012-09-17 18:30
(Received via mailing list)
On Mon, Sep 17, 2012 at 2:04 AM, GPad <peterpan105105@yahoo.it> wrote:
> Hi,
> I have VS installed but the problem seems related to the generation of code
> with an installed version of ruby (that I have ...)

Gianluca, Ruby doesn't build with VS (that I know of). You'll have to
install a version of Ruby from http://rubyinstaller.org/ and then
clone the repository at https://github.com/oneclick/rubyinstaller and
follow its directions.
Posted by Jakub Zieciak (wizard343)
on 2012-09-17 18:35
Why do you want to compile Ruby on Windows, when you can just download 
windows installer. If you really want to compile something, do it on 
Linux :)

Take care
Posted by Jon Forums (jonm)
on 2012-09-17 20:37
Eric Christopherson wrote in post #1076323:
> On Mon, Sep 17, 2012 at 2:04 AM, GPad <peterpan105105@yahoo.it> wrote:
>> Hi,
>> I have VS installed but the problem seems related to the generation of code
>> with an installed version of ruby (that I have ...)
>
> Gianluca, Ruby doesn't build with VS (that I know of). You'll have to
> install a version of Ruby from http://rubyinstaller.org/ and then
> clone the repository at https://github.com/oneclick/rubyinstaller and
> follow its directions.


While you can build part of the core of ruby with VS (I do it with
WinSDK 7.1 on Win7 32bit), one of the main issues is the dependency
libraries and keeping everything using the same msvcrt version. I know
of one person who creatively solves this puzzle; his solution is
documented in our RubyInstaller ML.

That said, it's so much easier to either download one of our pre-built
installers, or build from source by cloning our repo.

We make it almost trivial to build a full ruby from source with our
build recipes. The recipes download everything the build needs into a
sandbox and builds with an internal (selectable) mingw/mingw-w64 based
toolchain.

We even give you the capability to easily build tweaked versions. For
example, say you've cloned our repo to `C:\projects\rubyinstaller` and
you've cloned the ruby repo to `C:\projects\ruby-core` and you want to
build `trunk` using the recently announced 32bit TDM/MinGW 4.7.1
toolchain (we call 'em
DevKit's!).

One way to build is:

  cd c:\projects\rubyinstaller
  rake ruby19 local=c:\projects\ruby-core dkver=tdm-32-4.7.1

That's not so hard is it?

Once the build finishes you can test it all, grab the built artifacts
from the sandbox or tell the recipes to bundle everything up into a
convenient archive, and more.

We even have nice Jenkins-based CI server and goodies at
http://ci.rubyinstaller.org/

So, if you want to build Ruby for Windows on Windows (with or without
tweaks), we make it easy to do. You don't need to cross-compile from
Linux, even though you can if you'd like.

This should be enough to get you started. If it's not, swing by our ML
at

https://groups.google.com/forum/?fromgroups#!forum...

and Luis, myself, or one of the other awesome RubyInstaller contributors
will try to help you out.

Jon

---
Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.
http://thecodeshop.github.com | http://jonforums.github.com/
twitter: @jonforums
Posted by Gianluca GPad (gpad)
on 2012-09-18 10:02
(Received via mailing list)
> Gianluca, Ruby doesn't build with VS (that I know of). You'll have to
> install a version of Ruby from http://rubyinstaller.org/ and then
> clone the repository at https://github.com/oneclick/rubyinstaller and
> follow its directions.
>

This is what I did!!

In my first e-mail I wrote:

> I download the source from github:

> 1) Executed win32\configure.bat --> OK
> 2) launch nmake and this is the result:

> compiling ./enc/trans/big5.c
> big5.c
> c1 : fatal error C1083: Cannot open source file: './enc/trans/big5.c': No such 
file or directory
> NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 
10.0\VC\BIN\cl.EXE"' : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 
10.0\VC\BIN\nmake.EXE"' : return code '0x2


Someone ask me If I have installed VS on my machine and I say Yes, but I 
try to compile Ruby from the command line.

I have also ruby installed(ruby 1.9.2p180)....

Sorry for the confusion


bye
Gianluca
Posted by Gianluca GPad (gpad)
on 2012-09-18 10:07
(Received via mailing list)
> Da: Jon Forums <lists@ruby-forum.com>
> Inviato: Luned 17 Settembre 2012 20:37


>
> We make it almost trivial to build a full ruby from source with our
> build recipes.
> [...]
>
> One way to build is:
>
>  cd c:\projects\rubyinstaller
>  rake ruby19 local=c:\projects\ruby-core dkver=tdm-32-4.7.1
>


Thanks for your help, I will try and let you know

bye
Gianluca
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.