b r a y d e n . o r g / Software

/ WebHome / LanguagePages / RubyLanguage / MerbDataMapperOnWindows

This Web


WebHome  
Topic List  
Web Statistics 

All Webs


Books
Main
Random
Software
TWiki  

brayden.org


Home
Monthly Digest
Today's Links
Resumé
Reading List
Books RSS
Random RSS
Software RSS

Other


Dale's Blog

currently-reading
TextDrive

Installing merb and datamapper on windows

Pretty painless overall. Here's a transcript and some notes.

Resources:

First, you will need a compiler:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\etc>nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.

Then follow the instructions at nuance9, but just leave off the sudo:

C:\etc>gem install merb --include-dependencies
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed merb-0.4.1
Successfully installed erubis-2.4.1
Successfully installed abstract-1.0.0
Successfully installed mime-types-1.15
Successfully installed rubigen-1.1.1
Successfully installed activesupport-1.4.4
Installing ri documentation for merb-0.4.1...
Installing ri documentation for mime-types-1.15...
Installing ri documentation for rubigen-1.1.1...
Installing ri documentation for activesupport-1.4.4...
Installing RDoc documentation for merb-0.4.1...
Installing RDoc documentation for mime-types-1.15...
Installing RDoc documentation for rubigen-1.1.1...
Installing RDoc documentation for activesupport-1.4.4...

C:\etc>gem install datamapper
Install required dependency fastthread? [Yn]
Select which gem to install for your platform (i386-mswin32)
 1. fastthread 1.0.1 (ruby)
 2. fastthread 1.0 (ruby)
 3. fastthread 1.0 (mswin32)
 4. fastthread 0.6.4.1 (ruby)
 5. fastthread 0.6.4.1 (mswin32)
 6. Skip this gem
 7. Cancel installation
> 1
Building native extensions.  This could take a while...
Successfully installed datamapper-0.2.3
Successfully installed fastthread-1.0.1
Installing ri documentation for datamapper-0.2.3...
Installing ri documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing RDoc documentation for datamapper-0.2.3...
Installing RDoc documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump

C:\etc>gem install ruby2ruby --include-dependencies
Successfully installed ruby2ruby-1.1.7
Successfully installed ParseTree-2.0.2
Successfully installed hoe-1.3.0
Successfully installed rubyforge-0.4.4
Successfully installed rake-0.7.3
Successfully installed hoe-1.3.0
Installing ri documentation for ruby2ruby-1.1.7...
Installing ri documentation for ParseTree-2.0.2...
Installing ri documentation for hoe-1.3.0...
Installing ri documentation for rubyforge-0.4.4...
Installing ri documentation for rake-0.7.3...
Installing ri documentation for hoe-1.3.0...
Installing RDoc documentation for ruby2ruby-1.1.7...
Installing RDoc documentation for ParseTree-2.0.2...
Installing RDoc documentation for hoe-1.3.0...
Installing RDoc documentation for rubyforge-0.4.4...
Installing RDoc documentation for rake-0.7.3...
Installing RDoc documentation for hoe-1.3.0...

C:\etc>gem install merb_datamapper
Successfully installed merb_datamapper-0.4.4
Installing ri documentation for merb_datamapper-0.4.4...
Installing RDoc documentation for merb_datamapper-0.4.4...
Note that in the install of fastthread I chose the 'ruby' option - you can choose the win32 option and avoid building anything at that step.

Just to be sure, I also updated my json install:

C:\etc>gem update json
Updating installed gems...
Attempting remote update of json
Select which gem to install for your platform (i386-mswin32)
 1. json 1.1.1 (mswin32)
 2. json 1.1.1 (ruby)
 3. json 1.1.0 (mswin32)
 4. json 1.1.0 (ruby)
 5. Skip this gem
 6. Cancel installation
> 1
Successfully installed json-1.1.1-mswin32
Installing ri documentation for json-1.1.1-mswin32...

No definition for cState_configure

No definition for cState_configure
Installing RDoc documentation for json-1.1.1-mswin32...

No definition for cState_configure

No definition for cState_configure
Gems: [json] updated

By the way, I tried building the native extensions for json (by selecting option 2 json 1.1.1 (ruby) above) It was a dismal failure, with multiple invalid cl arguments, missing libs, etc. I didn't take the time to track that down, since I assume many people have run into the problem and if the problem is not fixed it's because the json developer doesn't have the time or interest. The mswin32 version installs just fine, as shown.

To use datamapper you need a native database driver. I don't really like mysql, and I like postgres a lot, so that's what I went for, again using the instructions at Getting started with datamapper. Sadly, this just didn't work, and never will on windows until the datamapper developer changes the rakefile:

C:\etc>cd \bin\ruby\lib\ruby\gems\1.8\gems\datamapper-0.2.3

C:\bin\ruby\lib\ruby\gems\1.8\gems\datamapper-0.2.3>rake dm:install:postgresql
(in C:/bin/ruby/lib/ruby/gems/1.8/gems/datamapper-0.2.3)
The system cannot find the path specified.

The problem is that the datamapper rake install target for dataobjects is unix/linux specific : sh (sudo gem ...).

So, I tried 'gem install do_postgres'. This almost worked, except it couldn't find pq.lib. Thanks to help at rubytalk I added the postgres lib and include directories to my LIB and INCLUDE environment and added the bin and lib directories to my PATH environment, just for good measure, and copied the lib/ms/libpq.lib to lib/pq.lib, and got a good install of the dataobjects postgres driver:

C:\etc>set lib
LIB=C:\bin\SoapGateway\lib;C:\lib;C:\Program Files\PostgreSQL\8.2\lib;C:\Program
 Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual St
udio\VC98\lib

C:\etc>set include
INCLUDE=C:\bin\SoapGateway\include;C:\lib;c:\include;C:\Program Files\PostgreSQL
\8.2\include;C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Progra
m Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visu
al Studio\VC98\include

C:\etc>set path
Path=C:\bin\Java\jdk1.6.0_01\bin;c:\bin\ruby\bin;C:\Perl\bin\;C:\WINDOWS\system3
2;C:\WINDOWS;C:\WINDOWS\system32\WBEM;c:\Python22;C:\bin;c:\lib;C:\Program Files
\PC-Doctor for Windows\services;C:\Program Files\UltraEdit;C:\lib\ATT\Graphviz\b
in;C:\Program Files\Subversion\bin;c:\Program Files\Microsoft SQL Server\90\Tool
s\binn\;C:\Program Files\PostgreSQL\8.2\bin;C:\Program Files\QuickTime\QTSystem\;
C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Vi
sual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio\Common\Tools
\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Fil
es\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio
\VC98\bin;C:\Program Files\PostgreSQL\8.2\bin;C:\Program Files\PostgreSQL\8.2\li
b;
C:\etc>gem install do_postgres
Need to update 6 gems from http://gems.rubyforge.org
......
complete
Building native extensions.  This could take a while...
Successfully installed do_postgres-0.2.1
Installing ri documentation for do_postgres-0.2.1...
Installing RDoc documentation for do_postgres-0.2.1...
C:\etc>

Apparent success!

 
 
Current Rev: r1.1 - 24 Nov 2007 - 17:21 GMT - DaleBrayden, Revision History:Diffs | r1.1
© 2003-2011 by the contributing authors.