Gem - install to different bindir?

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?

regards.

-a

···

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
anything that contradicts experience and logic should be abandoned.
-- h.h. the 14th dalai lama

===============================================================================

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.

jeremy

···

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?

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.

a more generic option might be a way to clobber Config::CONFIG values.
something like

   --config bindir=/usr/local/bin/

   -c bindir=/usr/local/bin

or just take any key value paris on the command line like

   bindir=/usr/local/bin

which would, in turn, do

   Config::CONFIG['bindir'] = '/usr/local/bin'

so - go ahead and support command line munging of rbconfig if it's taken to be
the master.

i could easily work up a patch if people are interested?

-a

···

On Thu, 27 Oct 2005, Jeremy Kemper wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
anything that contradicts experience and logic should be abandoned.
-- h.h. the 14th dalai lama

===============================================================================

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

···

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.

you mean rubygems doesn't use rbconfig!?

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

the location i'm installing to is mounted by 50 nodes what already have the
bindir it their path... i'm loath to have to modify 50 .bashrc files... uggh.

-a

···

On Thu, 27 Oct 2005, Jeremy Kemper wrote:
--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
anything that contradicts experience and logic should be abandoned.
-- h.h. the 14th dalai lama

===============================================================================