Tell me about it. It's a nightmare. I have to work with windows
for work (linux at home). Which means I don't have much understanding
of it either, or time to try things in my spare time.
I don't know why they don't bundle them with the install.
I don't know if there's some kind of licensing issues for
the dlls that means they can't bundle them or something
I spent around a week trying to get it up and running.
And probably around another week trying to get the
gems I needed running.
I almost got to the point of having to cancel the idea
of using ruby or ruby on rails for my project.
The loss of time has also meant I have less time for coding
and less time to try and help others.
But it's the weekend now, so I'll try my best to fill in the details.
Anyway, I'll look into it and try and figure out whether I can just
zip up my install and make that available.
Here's a rough summary of some of the things I needed to do
that I can remember:
Install the MinGW32 version which is compiled with the GNU
compiler rather than Microsoft Visual C++.
For any gems, choose the MINGW32 version.
I also had the fun of being btrehind a corporate firewall.
What this means is that you have to set the HTTP_PROXY
environment variable.
However, in practice I found that my proxy partially downloads
the file and saves it to disk with 0 bytes, (which triggers ruby into
action on a 0 byte file), my proxy then virus scans and after a
while sends the whole file, (but ruby has already given me an
error about an invalid gem format or something like that).
If I'm lucky the error message will contain the URL that
the gem was attempted to be downloaded from.
I can then wget this to a directory I created for downloaded gems
then do a
gem install -l gemname
When you try and start a console session.
You''ll get a bunch of missing DLL error messages.
These are clues, and you need to go treasure hunting
on those sites that provide downloads for missing DLLs.
I guess this is the MS equivalent of apt-get.
I spent perhaps a full day on downloading these alone.
That was really painful, and another reason why I'd be happy
to zip up my install.
I believe that at one point I had to build the ODBC from source.
Which is available
here.
I'm not a C/C++ developer and so that stuff is a bit of a mystery to me.
But I'm pretty sure that the MSWin32 version didn't work and
so that's why I needed to compile for MinGW32.
I'm also not certain what combination of things resulted in
the magic of things working for me.
When I said native for windows what I meant is this.
If you are using ODBC then you can create an ODBC connection
file which stores connection information on your PC.
This is available in Control Panel>Administrative Tools>ODBC Data sources
(I think)
You can choose to create an ODBC data source and if you select the
type from the drop down then there's an option for each of the drivers
you have installed. E.g. MySQL and Oracle don't come as default.
I can't remember if SQL Server comes as default or not.
Anyway in this list, I had two types for SQL Server.
One was native, and the other non-native. I can't remember if that's
the exact naming or not.
I read somewhere else that the native driver only works for 2005 i.e.
not 2000. Luckily, for me I'm using 2005.
It was changing my ODBC connections to native that worked for me (with
this rails-sqlserver-adapter).
I'd guess that native means C++ based, and that non-native is
programmed using .Net. I guess the non-native is more flexible, and
the native version needs to be compiled for the processor architecture.
(I didn't have to do that, but perhaps whenever I installed the SQL
server tools it did this).
I think because of the barrier to entry for windows users, unfortunately
there's not much useful information available. Maybe those who have
entered Ruby-on-Rails world on a windows platform must be fewer in
number, and have much less free time as a result.
Anything that I say here could easily be outdated within a month.
In general I spent a lot of time googling irrelevant information and
finding out about other people's difficulties, which were 90% of the
time not useful for me.
I generally find that the chain of dependencies for the various gems
is often so complex (given that they may not work for ruby 1.9.1,
or for windows or for the MingW32 platform, or they may not be compatible
with the specific other gems you are using, etc), that sometimes
it seems that your specific requirements are not possible to be met.
Also there's not a great deal of crossover between people who understand
the linux build process/C++/ruby/windows/windows build process for MingW32.
So I may speak to C++ experts about what I need to do to get a native gem working,
who lose interest when I talk about anything Ruby (but may understand
the build process). Or there may be some really helpful linux/mac ruby experts who
have no idea about compiling things or windows.
My basic requirements were
Cucumber
Rails
Ruby 1.9.1 (for better unicode)
Oracle
SQL Server
MySQL
sqlite
ImageMagick/RMagick (I've still not cracked this yet)
I hope that any of this info helps someone in the future.