Compiling āpgā on MS Windows
In order to build this extension on MS Windows you will need a couple things.
First, a compiler. For the one click installer this means you should use the DevKit or the compiler that comes with cygwin if youāre building on that platform.
If youāve built Ruby yourself, you should use the same compiler to build this library that you used to build Ruby.
Second, PostgreSQL. Be sure you installed it with the development header files if you installed it using the standard PostgreSQL installer for Windows. If you didnāt, you can run the installer again, select āmodifyā, and then select the ādevelopment headersā option to install them.
I recommend making sure that āpg_config.exeā is in your PATH. The PostgreSQL installer for Windows does not necessarily update your PATH when it installs itself, so you may need to do this manually. This isnāt strictly necessary, however.
In order to build ruby-pg, just run ārakeā. If the pg_config.exe executable is not in your PATH, youāll need to explicitly point ruby-pg to where your PostgreSQL headers and libraries are with something like this:
rake --with-pg-dir=c:/progra~1/postgr~1/8.3
Adjust your path accordingly. BE SURE TO USE THE SHORT PATH NAMES! If you try to use a path with spaces in it, the nmake.exe program will choke.
Building binary āpgā gems for MS Windows
Binary gems for windows can be built on Linux, OS-X and even on Windows with the help of docker. This is how regular windows gems are built for rubygems.org .
To do this, install boot2docker on Windows or on OS X and make sure it is started. A native Docker installation is best on Linux.
Then run:
rake gem:native
This will download a docker image suited for building windows gems, and it will download and build OpenSSL and PostgreSQL. Finally the gem is built containing binaries for all supported ruby versions.
Reporting Problems
If you have any problems you can submit them via the projectās issue-tracker. And submit questions, problems, or solutions, so that it can be improved.