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
at
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
pr-zlib
gem, if you want to use rubygems. Building from source will require
using a
Visual Studio solution (.sln) that comes with the zlib source in the
win32
subdirectory (iirc).
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
the
.h files (like c:/usr/zlib/include), and then cd back into the ruby
source,
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
up.
Building openssl should be easier. Just put the source in a simple
location
(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;
nmake install”.
Hope that helps.
Dan