ruby18 vs. ruby

M

meino.cramer

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." :)
 
R

ranx

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." :)

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

meino.cramer

ranx said:
Can simply create a symbolic link called ruby that points to ruby18 as
follows:
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

M. Edward (Ed) Borasky

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

meino.cramer

M. Edward (Ed) Borasky said:
(e-mail address removed) 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
 
J

John Joyce

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.
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top