Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

gem - install to different bindir?

1 view
Skip to first unread message

Ara.T.Howard

unread,
Oct 26, 2005, 4:21:59 PM10/26/05
to

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

Jeremy Kemper

unread,
Oct 26, 2005, 4:36:26 PM10/26/05
to
-----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.

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

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


Ara.T.Howard

unread,
Oct 26, 2005, 4:50:53 PM10/26/05
to
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.

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?

Jeremy Kemper

unread,
Oct 26, 2005, 5:24:52 PM10/26/05
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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


Ara.T.Howard

unread,
Oct 26, 2005, 5:30:49 PM10/26/05
to
On Thu, 27 Oct 2005, Jeremy Kemper wrote:

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

0 new messages