making ruby19 main ruby

C. Florian Ebeling florian.ebeling at
Sat May 9 02:30:23 PDT 2009

On Fri, May 8, 2009 at 3:28 AM, Alexy Khrabrov <deliverable at> wrote:
> How do I make the ruby1.9 from the port ruby19 my main ruby?

You can install ruby 1.9 with the command

  sudo port install ruby19+nosuffix

and then the executables will not be suffixed with the
version. That makes this port conflict then with ruby,
rb-rubygems, and rb-rake. (Rake and rubygems are
part of the standard ruby release beginning with 1.9).

> Also,
> how do you make it coexist with the Leopard ruby from the framework,
> and/or MacRuby?

Preinstalled ruby and MacPorts rubys can coexist because
mp uses it's own prefix, /opt/local/, while preinstalled uses

If you want one or the other version, you have to either
use the full path (/usr/bin/ruby for preinstalled, e.g.), or
change the PATH variable.

Executable ruby scripts may have a shebang line which
would bypass the PATH setting. In that case you can
force the interpreter in the shell by passing the script
to the interpreter you need.

  /usr/bin/ruby ./myscript.rb

> Do folks use a central gem directory?

No, each installation keeps it's own gem repository.
You can examine your various gem configurations with

  'gem environment'

(or just 'gem e' for short). So

/opt/local/bin/gem e
/usr/bin/gem e

should show you diffrent repository locations. The relevant


Florian Ebeling
Twitter: febeling
florian.ebeling at

More information about the macports-users mailing list