Forum: Ruby ruby18 vs. ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2007-03-25 06:59
(Received via mailing list)
Hi,

 I am using the ruby-stable-snapshot on a more or less regualr basis
 on a Gentoo Linux system. I do not install ruby via Gentoo's emerge
 mechanism.

 Suddenly all my ruby scripts stops to work. :)

 I noticed, that ruby was not installed as "ruby" but as "ruby18".
 My script's hash-bangs always are "#! /usr/bin/ruby".

 How can I convince configure to install ruby as ruby?

 I tried to set an environment variable "RUBY_INSTALL_NAME" but it
 does not work (yes, it was "exported" :)

 Thank you very much for any help in advance!

 Kind regards,
 mcc

 PS: May be it would be an idea to name the archive on rubys
 ftp-server like its contents:
 snapshot.tgz ---> ruby-snapshot.tgz
 stable-snapshot.tgz ---> ruby-stable-snapshot.tgz

 ...one (at least me ;) downloads a LOT of snapshots, source archives
 and so on. If not unpacked, configured,compiled, installed
 right directly after download - it is confusing to have archives
 "without name" like: source.tgz, stable-source.tgz, archive.zip,
 my_distro.7z,.....

 "That's four small chars for a ftp-server, one giant leap for
rubykind." :)
ranx (Guest)
on 2007-03-25 08:01
(Received via mailing list)
On Mar 24, 10:58 pm, removed_email_address@domain.invalid wrote:
>
>  PS: May be it would be an idea to name the archive on rubys
>  "That's four small chars for a ftp-server, one giant leap for rubykind." :)
>
> --
> Please don't send me any Word- or Powerpoint-Attachments
> unless it's absolutely neccessary. - Send simply Text.
> Seehttp://www.gnu.org/philosophy/no-word-attachments.html
> In a world without fences and walls nobody needs gates and windows.

Can simply create a symbolic link called ruby that points to ruby18 as
follows:
ln -s /usr/bin/ruby18 /usr/bin/ruby
unknown (Guest)
on 2007-03-25 08:10
(Received via mailing list)
ranx <removed_email_address@domain.invalid> [07-03-25 06:02]:
> >  My script's hash-bangs always are "#! /usr/bin/ruby".
> >
> >
> ln -s /usr/bin/ruby18 /usr/bin/ruby
Hi,

 thanks for your reply, ranx...already know symlinks...being a UNIX
 freak since 14 years now... ;)

 I wanted to install things correctly and dont "fix" problems by
 tweaking...otherwise other application/install may fail by finding
 "two" rubys...for example "RUBY_INSTALL_NAME" is used in the
 configure script at a lot of places. The libs also get their names
 from that. Symlinks will more harm than cure...


 How can I convince rubys configure/install system to use "ruby"
 instead of "ruby18" ?

 Keep scripting!
 mcc
M. Edward (Ed) Borasky (Guest)
on 2007-03-25 09:01
(Received via mailing list)
removed_email_address@domain.invalid wrote:
>
I run Gentoo Linux, but I use the Ruby from Portage. If you keyword it
in "/etc/portage/package.keywords", you'll get a fairly recent Ruby. For
example, Ruby 1.8.6 showed up in Portage only a day or so after the
upstream release.

But if you want to use Ruby snapshots as your main Ruby, there's a
couple of things you can do:

1. When you do the "./configure", the *default* is to install in
"/usr/local". However, if you use

     ./configure --prefix=/usr

     it will switch to /usr, so everything will end up in the same place
a regular "emerge ruby" would show up.

2. I've never used this, but a number of Ruby scripts I've looked at
start with

     #! /usr/env/ruby

     which by some magic knows where to find the Ruby interpreter.

3. As someone pointed out, after you do the install, you should be able
to go into /usr/bin (or /usr/local/bin, if you didn't use a --prefix on
your configure) and do

     ln -s ruby18 ruby

     However, I think the "make install" does that.

4. If you did the default install, change all your scripts to

    #! /usr/local/bin/ruby

5. Don't forget -- if you're installing other things from Portage that
have Ruby as a dependency, you'll need to tell Portage that you've
installed Ruby. Otherwise, it will download and install Ruby from
Portage. To do this, you'll need to add a line to
/etc/portage/package.provided that says

     =ruby-1.8.6

     or whatever the current release of Ruby is in Portage. Do "emerge
-pv ruby" and it will tell you the current version.

--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.
unknown (Guest)
on 2007-03-25 09:19
(Received via mailing list)
M. Edward (Ed) Borasky <removed_email_address@domain.invalid> [07-03-25 07:01]:
> removed_email_address@domain.invalid wrote:
Hi Ed,

 thanks for your reply.

 My question was:

 How can I convince the configure/install system of the ruby stable
 snapshot release to use

  ruby

 for RUBY_INSTALL_NAME instead of

  ruby18

 ?

 Thanks a lot for any helpful answer to my above question.

 Kind regards,
  mcc
John J. (Guest)
on 2007-03-25 11:57
(Received via mailing list)
The symlink is the best solution.
It is equivalent to having two names.
Paths will resolve to either name.
you could also just rename it, but that is slightly less reliable
than the symlink.
This topic is locked and can not be replied to.