gem - install to different bindir?

A

Ara.T.Howard

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
===============================================================================
 
J

Jeremy Kemper

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

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.

jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDX+jJAQHALep9HFYRAvxTAKC5bJoikmojQVKQUf6xvDc+ynmqGgCbBrON
F8Szy+eVauOeyGSaKxns8ZM=
=h17p
-----END PGP SIGNATURE-----
 
A

Ara.T.Howard

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



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.

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
--
===============================================================================
| 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
===============================================================================
 
J

Jeremy Kemper

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

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-----
 
A

Ara.T.Howard

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
--
===============================================================================
| 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
===============================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top