Forum: Ruby on Rails Where's Ruby? Too many Ruby interpreters on OS X.

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.
2a9c22889b0dc4614db14c9e2a9c5a12?d=identicon&s=25 Bill Edstrom, Jr. (Guest)
on 2006-05-23 15:50
(Received via mailing list)
I seem to have two versions of Ruby on my PowerBook. I have been
learning
RoR and walked through the online scripted install of Ruby and Rails
several
weeks ago before I really understood what was going on.

If I open Terminal and type:

ruby -v


I get back:

ruby 1.8.4 (2005-12-24) [powerpc-darwin8.5.0]


So that looks fine, but I don't know where my Ruby interpreter is
located. I
realize this when I downloaded and installed the Komodo IDE over the
weekend. When Komodo loads a Ruby I get backs:

Ruby 1.8.2 [powerpc-darwin8.0]
>

I think this is the default OS X ruby interpreter. In the Komodo
Preferences
I found that Komodo is pointing to /usr/bin/ruby for it's interpreter. I
thought this was where my Rails programs were going for Ruby but that is
clearly not the case.

I don't want to have more than one version of Ruby. I know the source
files
for the version that I installed myself are located at

I know my source files are located under my home directory at /src/ruby-
1.8.4. Where should I look for my working Ruby install?
B07c187ac858535358faa9365b66e657?d=identicon&s=25 John Tsombakos (Guest)
on 2006-05-23 15:53
(Received via mailing list)
On 5/23/06, Bill Edstrom, Jr. <w.edstrom@gmail.com> wrote:
> > ruby 1.8.4 (2005-12-24) [powerpc-darwin8.5.0]
...
>
> I know my source files are located under my home directory at
> /src/ruby-1.8.4 . Where should I look for my working Ruby install?

Type:

  which ruby

in the terminal to see where the version of Ruby that is the default is
located.

jt
4daf0b71d5d9a3882e583c0e72eaf5dc?d=identicon&s=25 Alan Francis (Guest)
on 2006-05-23 16:42
Bill Edstrom, Jr. wrote:
> I seem to have two versions of Ruby on my PowerBook. I have been
> learning
> RoR and walked through the online scripted install of Ruby and Rails
> several
> weeks ago before I really understood what was going on.

If it's the walkthrough I think it is, you installed 1.8.4 in /usr/local
and put /usr/local/bin first in your path.  This means from the shell,
you get /usr/local/bin/ruby (which is 1.8.4).   If Komodo is hardcoded
to point to /usr/bin (instead of using the path) it'll get 1.8.2.

You can run which ruby from the shell to confirm my thinking :-)

If you can configure Komodo and tell it to use a different Ruby, do that
(/usr/local/bin/ruby).

If you can't, or maybe even if you can't, I also rm /usr/bin/ruby and
create a symlink there to /usr/local/bin/ruby, just to be sure, but
YMMV.

cd /usr/bin

sudo mv ruby ruby.old
sudo mv ri ri.old
sudo mv irb irb.old
sudo mv rdoc rdoc.old

sudo ln -s /usr/local/bin/ruby
sudo ln -s /usr/local/bin/ri
sudo ln -s /usr/local/bin/irb
sudo ln -s /usr/local/bin/rdoc

This way, if anyone hardlinks to /usr/bin, they'll get your local
version instead.

Alan
2a9c22889b0dc4614db14c9e2a9c5a12?d=identicon&s=25 Bill Edstrom, Jr. (Guest)
on 2006-05-23 18:43
(Received via mailing list)
>   which ruby
>
> in the terminal to see where the version of Ruby that is the default is
> located.



Ok, typing "which ruby" give me:

/usr/local/bin/ruby

as predicted in the next email!

Making progress.......!!!!
2a9c22889b0dc4614db14c9e2a9c5a12?d=identicon&s=25 Bill Edstrom, Jr. (Guest)
on 2006-05-23 18:47
(Received via mailing list)
Komodo is not hard coded. I can point it to any Ruby interpreter. I was
really just trying makes sure my development enviroment was clean.

Thanks. The RoR community and this list are Awesome!
This topic is locked and can not be replied to.