Cannot install ruby-postgres on Windows

My system is Windows Server 2008 SP2

Ruby and gem versions:

ruby-postgres is deprecated. Use "pg" instead.

You have to install development tools firs

Hello again. It is trying to install from source instead of binary, which requires a compiler. Try setting the platform to mswin32 and it will hopefully install the binary version.

gem install ruby-postgres --platform=mswin32

Sharagoz -- wrote:

You have to install development tools firs

Hello again. It is trying to install from source instead of binary, which requires a compiler. Try setting the platform to mswin32 and it will hopefully install the binary version.

gem install ruby-postgres --platform=mswin32

WORKS!

See below Thanks!

Fernando Perez wrote:

ruby-postgres is deprecated. Use "pg" instead.

Hello Fernando,

It also works with your suggestion, thank you.

But then, if both the deprecated ruby-postgres is installed along with pg (see the gem list below), is there any problem ? Will rails use by default pg instead of ruby-postgres ?

Try setting the platform to mswin32 and it will hopefully install the binary version.

gem install ruby-postgres --platform=mswin32

Looks like this only installs binaries for 1.8.6 (same with the pg gem). If you want to use ruby mingw 1.9.1 with them (which is the OP's version), you'll have to download the headers and compile from source.

Roger Pack wrote:

Try setting the platform to mswin32 and it will hopefully install the binary version.

gem install ruby-postgres --platform=mswin32

Looks like this only installs binaries for 1.8.6 (same with the pg gem). If you want to use ruby mingw 1.9.1 with them (which is the OP's version), you'll have to download the headers and compile from source.

Thanks for the comment Roger.