On Monday, January 20, 2014 2:57:32 PM UTC-7, Richard Secrist wrote:
I am not allowed to use a Windows install kit at work and must build
Ruby from source on Windows 7. Are there good, recent instructions on
doing this? I also need to minimize any gcc/MinGW/Cygwin influences
even at runtime so I don’t have to build those from source too. My
target is to use WATIR with an IE browser through the Selenium
IEDriverServer so I need to keep that working, but I could jettison
other stuff from the pom if I need to. Any insight on doing such things
is greatly appreciated!
If you download the source, cd to the “win32” directory and take a look
the README.win32 file. Or, just run win32\configure.bat
–prefix=c:/your_ruby, nmake, nmake install.
You will have to build the zlib extension from source, or use the
gem, if you want to use rubygems. Building from source will require
Visual Studio solution (.sln) that comes with the zlib source in the
One trick is that you will need to remove the ZLIB_WINAPI preprocessor
directive first. Copy the resulting .lib and .dll files somewhere handy
(like c:/usr/zlib/lib, and possibly also c:/your_ruby/bin), along with
.h files (like c:/usr/zlib/include), and then cd back into the ruby
under ext/zlib. Run “ruby extconf.rb --with-zlib-dir=c:/usr/zlib” (or
wherever you put it), nmake, nmake install.
You may need to rename the .dll and .lib files back to “zlib.dll” and
“zlib.lib” first, as the zlib folks keep messing with the resulting file
names for odd reasons, so the ruby extconf.rb script might not pick it
Building openssl should be easier. Just put the source in a simple
(c:/usr/openssl), cd to the ext/openssl subdirectory in the ruby source
code, and run “ruby extconf.rb --with-openssl-dir=c:/usr/openssl; nmake;
Hope that helps.