Hi guys, On my MacBook I''m noticing I''m having to install a gem three times (MRI, IronRuby, JRuby) - which is getting really annoying :) Am I doing something wrong??? Is there a way around this?? Thanks Ben
What gem? -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ben Hall Sent: Tuesday, January 05, 2010 3:38 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] One gem to rule them all? Hi guys, On my MacBook I''m noticing I''m having to install a gem three times (MRI, IronRuby, JRuby) - which is getting really annoying :) Am I doing something wrong??? Is there a way around this?? Thanks Ben _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Ben, do you mean each implementation is using a different RubyGems repository, so running "gem list" on each implementation gives you a different list? To work-around this, set both the "GEM_PATH" and "GEM_HOME" environment variables to be the RubyGem repo you want to use, and all the implementations will pull gems from only that one. For example, dev.bat in IronRuby''s source sets GEM_PATH to be a location we have checked in, so Ruby and IronRuby share the same gems. If GEM_HOME was also set, then installing would default to that location. ~js> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, January 05, 2010 3:43 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] One gem to rule them all? > > What gem? > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Ben Hall > Sent: Tuesday, January 05, 2010 3:38 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] One gem to rule them all? > > Hi guys, > > On my MacBook I''m noticing I''m having to install a gem three times (MRI, > IronRuby, JRuby) - which is getting really annoying :) > > Am I doing something wrong??? Is there a way around this?? > > Thanks > > Ben > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
you can share gems by setting a location in .gemrc But there be dragons. because gem install will only generate the proper executable links for the version that is installing the gem. if you don''t want to download the gems all the time then you can just reuse the .gem file from Assuming you have ruby installed in /usr /usr/lib/ruby/gems/1.9.1/cache if you share a location you can use gem pristine gem_name to (re)install the gem in the other ruby version. for libraries that don''t have any executables or native extensions that should work just fine. the core of the gems functionality is to add the paths /usr/lib/ruby/gems/1.9.1/gems/*/lib to the load path. The install process also copies the files from the gem/bin folder to /usr/lib/ruby/gems/1.9.1/bin and then to /usr/bin If you use homebrew then this stuff is hidden a little bit deeper because homebrew symlinks the lib,bin,var,.. folers from within a Cellar repository. So in short you should be able to do so but sometimes it might require a little bit of work to make it dance. http://blogs.sun.com/mandy/entry/rubygems_etc_gemrc --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Google Wave: portocarrero.ivan at googlewave.com Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Wed, Jan 6, 2010 at 12:38 AM, Ben Hall <ben2004uk at googlemail.com> wrote:> Hi guys, > > On my MacBook I''m noticing I''m having to install a gem three times > (MRI, IronRuby, JRuby) - which is getting really annoying :) > > Am I doing something wrong??? Is there a way around this?? > > Thanks > > Ben > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100106/75d457bd/attachment.html>
Hey Ben, This is a problem, but one that you''re better of living with. I''ve tried sharing gem homes in the past and it can get real messy right after you install your first native gem, of if you have bin scripts like Ivan pointed out. Perhaps you could create a wrapper shell script that invokes a gem install for each flavour of Ruby you have? Cheers, Sidu. http://blog.sidu.in http://twitter.com/ponnappa Ben Hall wrote:> Hi guys, > > On my MacBook I''m noticing I''m having to install a gem three times > (MRI, IronRuby, JRuby) - which is getting really annoying :) > > Am I doing something wrong??? Is there a way around this?? > > Thanks > > Ben > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >