Could not create Makefile. You have to install development tools first. Issue.

3,832 views
Skip to first unread message

Roy Wright

unread,
Jun 4, 2012, 7:24:30 PM6/4/12
to RubyInstaller
Howdy,

I've developed an internal test tool for our product that requires
ruby with native gems. Currently trying to port to Windows 2000
Server sp4 running on a VM (easy to revert, try again).

New installation of w2k-srv.

Installed gvim-7.3

Installed ruby-1.9.2-p136-i386-mswin32 to C:\\ruby192 with extra libs
(zlib, openssl, readline, pdcurses) under C:\\ruby192 (bin, doc,
include, lib sub-directories).

Installed DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe to C:\\DevKit
Ran ruby dk.rb init
Manually appended "- C:/ruby192" to config.yml
Ran ruby dk.rb install

C:\>ruby --version
ruby 1.9.2p136 (2010-12-25 revision 30365) [i386-mswin32]

C:\>gem list

*** LOCAL GEMS ***

minitest (1.6.0)
rake (0.8.7)
rdoc (2.5.8)

C:\>mkdir test

C:\>cd test

C:\test>gem install rdiscount --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.

c:/ruby192/bin/ruby.exe extconf.rb
checking for random()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--srcdir=.
--curdir
--ruby=c:/ruby192/bin/ruby
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/lib
c:/ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed
to generate an executable file. (RuntimeError)
You have to install development tools first.
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:797:in `block in
have_func'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in
checking_for'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2
levels) in postpone'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in
postpone'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from c:/ruby192/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
from extconf.rb:5:in `<main>'


Gem files will remain installed in c:/ruby192/lib/ruby/gems/1.9.1/gems/
rdiscount-1.6.8 for inspection.
Results logged to c:/ruby192/lib/ruby/gems/1.9.1/gems/rdiscount-1.6.8/
ext/gem_make.out

C:\test>vim hello.c

C:\test>\devkit\devkitvars
Adding the DevKit to PATH...

C:\test>gcc hello.c -o hello.exe

C:\test>hello
Hello World!

C:\test>cd \devkit

C:\DevKit>ruby dk.rb review
Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.

C:/ruby192

C:\test>type \ruby192\lib\ruby\gems\1.9.1\gems\rdiscount-1.6.8\ext
\mkmf.log
"cl -nologo -Feconftest -Ic:/ruby192/include/ruby-1.9.1/i386-mswin32 -
Ic:/ruby192/include/ruby-1.9.1
/ruby/backward -Ic:/ruby192/include/ruby-1.9.1 -I. -Ic:/ruby192/
include/ruby-1.9.1 -MD -Zi -W2 -O
2b2xg- -G6 -Zm600 conftest.c msvcrt-ruby191-static.lib oldnames.lib
user32.lib advapi32.lib shell
32.lib ws2_32.lib -link -incremental:no -debug -opt:ref -opt:icf -
libpath:. -libpath:c:/ruby192/
lib "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #define WIN32_LEAN_AND_MEAN
4: #define WIN32
5: #include <winsock2.h>
6: #include <ws2tcpip.h>
7: #include <windows.h>
8: int main() {return 0;}
/* end */

C:\test>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [i386-mswin32]
- INSTALLATION DIRECTORY: c:/ruby192/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: c:/ruby192/bin/ruby.exe
- EXECUTABLE DIRECTORY: c:/ruby192/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mswin32-60
- GEM PATHS:
- c:/ruby192/lib/ruby/gems/1.9.1
- C:/Documents and Settings/Administrator/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

C:\test>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users.WINNT
APPDATA=C:\Documents and Settings\Administrator\Application Data
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=QA-E11-99-243
ComSpec=C:\WINNT\system32\cmd.exe
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\Administrator
LOGONSERVER=\\QA-E11-99-243
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=C:\DevKit\bin;C:\DevKit\mingw\bin;C:\WINNT\system32;C:\WINNT;C:
\WINNT\System32\Wbem;c:\\ruby192
\bin;c:\\Program Files\Vim\vim73
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 12 Stepping 2, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0c02
ProgramFiles=C:\Program Files
PROMPT=$P$G
RI_DEVKIT=C:\DevKit\
SystemDrive=C:
SystemRoot=C:\WINNT
TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
USERDOMAIN=QA-E11-99-243
USERNAME=Administrator
USERPROFILE=C:\Documents and Settings\Administrator
windir=C:\WINNT


Note, the PATH above was after running devkitvars.bat.

I've tried installing rdiscount with/without "--verbose", "--debug"
flags but no change to mkfm.log. Also tried installing rdiscount
after running devkitvars.bat, no joy either.

Any idea where it is attempting to create the Makefile? A missing
directory is my current guess.

Any thing else I need to check?

Thank you,
Roy

Luis Lavena

unread,
Jun 4, 2012, 7:30:39 PM6/4/12
to rubyin...@googlegroups.com
On Mon, Jun 4, 2012 at 8:24 PM, Roy Wright <roywr...@gmail.com> wrote:
> Howdy,
>

Hello,

> I've developed an internal test tool for our product that requires
> ruby with native gems.  Currently trying to port to Windows 2000
> Server sp4 running on a VM (easy to revert, try again).
>
> New installation of w2k-srv.
>
> Installed gvim-7.3
>
> Installed ruby-1.9.2-p136-i386-mswin32 to C:\\ruby192 with extra libs
> (zlib, openssl, readline, pdcurses) under C:\\ruby192 (bin, doc,
> include, lib sub-directories).
>

Here is the first problem: you're trying to use RubyInstaller's DevKit
(which is GCC) with a Visual Studio build of Ruby.

That will not work due the nature of Ruby own build process.

You need a version of Ruby built with GCC, ala: RubyInstaller's own
builds available in the download page:

http://rubyinstaller.org/downloads/

While the installers have been limited to Windows XP, I believe the
build should work against Windows 2K. You can try the 7zip packages
instead of the installer.

> c:/ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed
> to generate an executable file. (RuntimeError)
> You have to install development tools first.
>
> [...]
>
>
> C:\test>type \ruby192\lib\ruby\gems\1.9.1\gems\rdiscount-1.6.8\ext
> \mkmf.log
> "cl -nologo -Feconftest -Ic:/ruby192/include/ruby-1.9.1/i386-mswin32 -
> Ic:/ruby192/include/ruby-1.9.1
> /ruby/backward -Ic:/ruby192/include/ruby-1.9.1 -I. -Ic:/ruby192/
> include/ruby-1.9.1    -MD -Zi -W2 -O
> 2b2xg- -G6 -Zm600 conftest.c   msvcrt-ruby191-static.lib  oldnames.lib
> user32.lib advapi32.lib shell
> 32.lib ws2_32.lib   -link -incremental:no -debug -opt:ref -opt:icf   -
> libpath:. -libpath:c:/ruby192/
> lib "
>
> [...]
>
> I've tried installing rdiscount with/without "--verbose", "--debug"
> flags but no change to mkfm.log.  Also tried installing rdiscount
> after running devkitvars.bat, no joy either.
>

See above, it is trying to use Visual C (cl.exe compiler).

> Any idea where it is attempting to create the Makefile?  A missing
> directory is my current guess.
>
> Any thing else I need to check?
>

Please download RubyInstaller builds, setup DevKit and let us know,
that is the error you're getting: you're using the wrong version of
Ruby.

RubyInstaller + DevKit: ruby -v will report "i386-mingw" (MinGW is GCC)
The Ruby you have: ruby -v reports "mswin" it requires Visual C to compile.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Roy Wright

unread,
Jun 4, 2012, 8:09:17 PM6/4/12
to rubyin...@googlegroups.com
Thank you!

I'm using the ruby installer for the other targets, but it reported that only nt 5.1.2600 (XP) and later was supported when I tried w2k so that's why I tried the mswin-32 version. I'll give the 7zip version a try.

Thank you!!!! I can stop bashing my head now...

Roy
> --
> You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
> To post to this group, send email to rubyin...@googlegroups.com.
> To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.
>

Roy Wright

unread,
Jun 5, 2012, 12:10:33 PM6/5/12
to rubyin...@googlegroups.com

On Jun 4, 2012, at 6:30 PM, Luis Lavena wrote:

> Here is the first problem: you're trying to use RubyInstaller's DevKit
> (which is GCC) with a Visual Studio build of Ruby.
>
> That will not work due the nature of Ruby own build process.
>
> You need a version of Ruby built with GCC, ala: RubyInstaller's own
> builds available in the download page:
>
> http://rubyinstaller.org/downloads/
>
> While the installers have been limited to Windows XP, I believe the
> build should work against Windows 2K. You can try the 7zip packages
> instead of the installer.

With ruby-1.9.3-p194-i386-mingw32.7z on w2ksp4, when I attempt the rdiscount install, I'm seeing a popup that says:

"The procedure entry point freeaddrinfo could not be located in the dynamic link library WS2_32.dll"

Here's the MS tech note: http://msdn.microsoft.com/en-us/library/ms737931%28VS.85%29.aspx

Basically it seems that for w2k Ws2tcpip.h and Wspiapi.h need to be required.


Thank you,
Roy



Luis Lavena

unread,
Jun 5, 2012, 12:15:27 PM6/5/12
to rubyin...@googlegroups.com
On Tue, Jun 5, 2012 at 1:10 PM, Roy Wright <roywr...@gmail.com> wrote:
>
> With ruby-1.9.3-p194-i386-mingw32.7z on w2ksp4, when I attempt the rdiscount install, I'm seeing a popup that says:
>
> "The procedure entry point freeaddrinfo could not be located in the dynamic link library WS2_32.dll"
>
> Here's the MS tech note:  http://msdn.microsoft.com/en-us/library/ms737931%28VS.85%29.aspx
>
> Basically it seems that for w2k Ws2tcpip.h and Wspiapi.h need to be required.
>

Don't have Windows 2K to test, but FreeAddrInfo seems to be missing in
WS2_32.dll, that is nothing to do with the compilation itself: it is
missing in your system DLL.

Jon

unread,
Jun 12, 2012, 3:19:43 PM6/12/12
to rubyin...@googlegroups.com
> I'm having a similar problem, and deleting the AutoRun from the registry
> did not help. I get the same error when I attempt to install rdiscount. I
> have DevKit as well as 1.9.2; ostensibly there can be a conflict between
> them.
>
> Here is the content of my mkmf.log file:
>
> "gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32
> -IC:/Ruby192/include/ruby-1.9.1/ruby/backward
> -IC:/Ruby192/include/ruby-1.9.1 -I. -O3 -g -Wextra
> -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings
> -Wno-missing-field-initializers -Wno-long-long conftest.c -L.
> -LC:/Ruby192/lib -L.
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\tk\\lib
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\tcl\\lib
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\libyaml\\lib
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\pdcurses\\lib
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\openssl\\lib
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\zlib\\lib
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\iconv\\lib
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\gdbm\\lib
> -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\libffi\\lib
> -lmsvcrt-ruby191-static -lshell32 -lws2_32 "
> c:/watir webdriver install -
> definative/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe:
> cannot find crt2.o: No such file or directory


First, install the DevKit to a directory *without* spaces rather than "C:\watir webdriver install - definative\devkit" and try again. Spacey dirs will cause you no end of grief ;)


Jon

---
Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.
http://thecodeshop.github.com | http://jonforums.github.com/
twitter: @jonforums

Harry Baer

unread,
Jun 13, 2012, 9:11:38 AM6/13/12
to rubyin...@googlegroups.com
Changed the folder name to WATIR.  No dice - same error log.  :-/

Luis Lavena

unread,
Jun 13, 2012, 9:13:37 AM6/13/12
to rubyin...@googlegroups.com

Sure? Have you also update ruby to the new devkit location?
Please provide the new output because I think is not the same.

Sorry for top posting. Sent from mobile.

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyinstaller/-/Ju4ClqSh_NQJ.

Harry Baer

unread,
Jun 13, 2012, 10:08:46 AM6/13/12
to rubyin...@googlegroups.com
To unsubscribe from this group, send email to rubyinstaller+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.


I uninstalled everything and restored the VM to its native state, and then started over from scratch.  But just in case the file is different, here's the content of the new mkmf:

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -I.     -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long conftest.c  -L. -LC:/Ruby192/lib -L. -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\tk\\lib -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\tcl\\lib -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\libyaml\\lib -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\pdcurses\\lib -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\openssl\\lib -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\zlib\\lib -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\iconv\\lib -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\gdbm\\lib -LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\libffi\\lib      -lmsvcrt-ruby191-static  -lshell32 -lws2_32  "
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find crt2.o: No such file or directory
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find crtbegin.o: No such file or directory
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lshell32
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lws2_32
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmingw32
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lgcc
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmoldname
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmingwex
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmsvcrt
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -luser32
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lkernel32
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -ladvapi32
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lshell32
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmingw32
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lgcc
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmoldname
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmingwex
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmsvcrt
c:/watir/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find crtend.o: No such file or directory
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

--
Harry Baer IV

Luis Lavena

unread,
Jun 13, 2012, 2:24:09 PM6/13/12
to rubyin...@googlegroups.com
On Wed, Jun 13, 2012 at 11:08 AM, Harry Baer <baeri...@gmail.com> wrote:
>
> I uninstalled everything and restored the VM to its native state, and then
> started over from scratch.  But just in case the file is different, here's
> the content of the new mkmf:
>

Seems is failing to find elements to link against, like crt2.o, which
should exist somewhere inside DevKit "mingw" directory.

Can you verify that file exists?

Can you also check the troubleshooting page, specially this:

https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-gems_fails_vista

If that doesn't work, we will need to have a TeamViewer session to
debug this issue.

To my bad I'm traveling right now, so access to internet is quite limited.

Luis Lavena

unread,
Mar 4, 2013, 11:19:07 AM3/4/13
to rubyin...@googlegroups.com
On Mon, Mar 4, 2013 at 11:09 AM, Kaushal Kapadia <kaus...@gmail.com> wrote:
> Hello All,
>
> I too am having the same problem - but this does not occur on trying to
> download every gem file. It downloads for some and for others -eg .json, it
> gives me the error.
> My output of ruby -v is :
> ruby 1.9.3p374 (2013-01-15) [i386-mingw32]
>

Please see above provided answers: you need to install the Development
Kit for this version.

Important: Ruby 1.9.3 uses tdm-32-4.5.2 devkit. mingw64 4.7.2 devkits
are only for Ruby 2.0
Reply all
Reply to author
Forward
0 new messages