On 2011-01-29, at 12:21, Jarmo Pertman wrote:

>>> I need to build a gem whose dependencies are dependent of the platform
>>> itself. For example when `gem install my_gem` is issued under Windows,
>>> then in gemspec i have to have spec.add_dependency("gemX"), but if the
>>> command is executed under linux then i need to have
>>> spec.add_dependency("gemY").

I have solved this by making the gem depend on the "bundler" gem, and then put the gem dependecies into a Gemfile, and run the equivalent of "bundle install" as a post-install script.  This takes care of everything.  The only thing I am missing is that the dependencies are visible when inspecting the gem.

Having RubyGems drop the gemspec dependencies in favor of Gemfile dependencies would be my preferred way.

--
With kind regards
Uwe Kubosch
Kubosch Consulting
uwe / kubosch.no
http://kubosch.no/