From: Jeremy Kemper Date: 2005-10-27T06:24:52+09:00 Subject: Re: gem - install to different bindir? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Oct 26, 2005, at 1:50 PM, Ara.T.Howard wrote: > On Thu, 27 Oct 2005, Jeremy Kemper wrote: >> On Oct 26, 2005, at 1:21 PM, Ara.T.Howard wrote: >>> i have the following setup >>> /usr/local/ruby-1.8.0 >>> /usr/local/ruby-1.8.3 >>> /usr/local/ruby-1.9.0 >>> /usr/local/bin/ruby180 -> /usr/local/ruby-1.8.0/bin/ruby >>> /usr/local/bin/ruby183 -> /usr/local/ruby-1.8.3/bin/ruby >>> /usr/local/bin/ruby190 -> /usr/local/ruby-1.9.0/bin/ruby >>> /usr/local/bin/ruby -> /usr/local/ruby-1.9.0/bin/ruby >>> only /usr/local/bin is in my path. say i want to install rake. >>> gem install rake >>> the lib files obviously go into >>> /usr/local/ruby-1.9.0/lib/ >>> but i want the bin files to land here >>> /usr/local/bin/rake >>> i see the --install-dir option, how does one specify separate lib >>> and bin >>> directories with gem installs? >> >> I have a similar multi-versioned Ruby install. I move the gem- >> installed binfiles by hand and rename them according the Ruby >> version they expect: e.g., gem19, rake18-cvs. It would be >> wonderful if RubyGems could reuse the details I already fed to >> ruby ./configure. > > an even simpler solution might be > require 'pathname' > bindir = Pathname::new($0).dirname > so, in the case of a link like > /usr/local/bin/ruby18 -> /usr/local/bin/ruby-1.8.1/bin/ruby > this would resolve to /usr/local/bin > > it seems that getting bindir info from rbconfig is simply not > correct - after > all, that was the bindir info for ruby - not the code one is currently > installing. Ah, I see, we have different problems. I want RubyGems to use the same paths and naming options I configured Ruby with; you want RubyGems to respect the 'apparent' Ruby bindir. I think you may simplify your install by eliminating the symlinks, using --program-suffix, and adding each bindir to your $PATH. Then, so long as RubyGems uses the same install options as Ruby, your gem installs would 'just work'. For example, with --prefix=/usr/local/ruby19 and --program-suffix=19 gem19 install rake could create /usr/local/ruby19/bin/rake19 jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDX/QlAQHALep9HFYRAmnTAJ9SLX+t4u1iwJ28gcOVpPeCWXTlZgCfRg0J WSUSZQpNzIfnXGUQzgD6sH0= =jIAB -----END PGP SIGNATURE-----