From: Alex Allmont Date: 2013-01-03T20:59:29+09:00 Subject: Cross-platform gems / conditional loading of gems --_000_1CE1BECC0915A6448EAE5D7080EDA9050442576C24oxexc1NMlocal_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, We use ruby as part of our development team tools for Windows and Mac machi= nes. This is maintained internally in an SVN repository where the platform= -specific files are interleaved, i.e. the bin/ directory contains both a Wi= ndows ruby.exe and a Mac ruby executable. This repository is packaged into= installers so we can deploy to our dev team ensuring that everyone has the= correct ruby version and gems. New gems are installed on an administrator's machine and SVN added to the g= ems folder (and the corresponding gemspec is added to the specifications fo= lder). Most of these are platform agnostic but we have a few that are Wind= ows-only, e.g. qtbindings. This was working fine until trying to get sqlite3 running on both PC and Ma= c. The PC version was installed first (gems/sqlite3-1.3.6-x86-mingw32) and= this worked fine. The mingw32 version is PC only so I installed sqlite3 o= n an OSX machine which added the new gem to gems\sqlite3-1.3.6. This new gem conflicts with the PC version, e.g. attempting to require via = IRB on the Mac: irb(main):001:0> require 'sqlite3' LoadError: cannot load such file -- sqlite3/sqlite3_native from /Users/aallmont/nm/buildtools/ruby/1.9.3/lib/ruby/site= _ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/aallmont/nm/buildtools/ruby/1.9.3/lib/ruby/site= _ruby/1.9.1/rubygems/custom_require.rb:36:in `require' This error goes away if I remove the gems/sqlite3-1.3.6-x86-mingw32 folder = on the Mac. There is a similar error on the PC which goes away if I remove= the gems/sqlite3-1.3.6-x86 folder, i.e. they are mutually exclusive. I would like to only load gems/sqlite3-1.3.6-x86 when running on the Mac an= d only load gems/sqlite3-1.3.6-x86-mingw32 when running on the PC. Is this= possible? Many thanks, Alex --_000_1CE1BECC0915A6448EAE5D7080EDA9050442576C24oxexc1NMlocal_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi all,

 

We use= ruby as part of our development team tools for Windows and Mac machines.&n= bsp; This is maintained internally in an SVN repository where the platform-= specific files are interleaved, i.e. the bin/ directory contains both a Win= dows ruby.exe and a Mac ruby executable.  This repository is packaged = into installers so we can deploy to our dev team ensuring that everyone has= the correct ruby version and gems.

 

New gems are installed on an administ= rator’s machine and SVN added to the gems folder (and the correspondi= ng gemspec is added to the specifications folder).  Most of these are = platform agnostic but we have a few that are Windows-only, e.g. qtbindings.=

 

This was working fine until trying to get sqlite3 running on both PC and= Mac.  The PC version was installed first (gems/sqlite3-1.3.6-x86-ming= w32) and this worked fine.  The mingw32 version is PC only so I instal= led sqlite3 on an OSX machine which added the new gem to gems\sqlite3-1.3.6= .

 

This new gem conflicts with the PC version, e.g. attempting to require = via IRB on the Mac:

 

irb(main):001:0> require 'sqlite3'

<= p class=3DMsoNormal>LoadError: cannot load such file -- sqlite3/sqlite3_nat= ive

      =           from /Users/aallmont= /nm/buildtools/ruby/1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.= rb:36:in `require'

   &nb= sp;            from = /Users/aallmont/nm/buildtools/ruby/1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/= custom_require.rb:36:in `require'

&= nbsp;

This error goes away if I remove the ge= ms/sqlite3-1.3.6-x86-mingw32 folder on the Mac.  There is a similar er= ror on the PC which goes away if I remove the gems/sqlite3-1.3.6-x86 folder= , i.e. they are mutually exclusive.

 

I would like to only load gems/sqlite= 3-1.3.6-x86 when running on the Mac and only load gems/sqlite3-1.3.6-x86-mi= ngw32 when running on the PC.  Is this possible?

 

Many thanks,

Alex

&= nbsp;

= --_000_1CE1BECC0915A6448EAE5D7080EDA9050442576C24oxexc1NMlocal_--