Putting -r ubygems in the path permanently?

According to the Ruby on Rails download page, Gems is "the soon-to-be official packaging format for Ruby libs/apps".

Putting "ubygems" in the -r value of the command line for every invocation of Ruby is getting old fast.

How do I configure Ruby or my (linux) server so that, server wide, it looks in ubygems for modules automatically?

Thanks,

-dB

···

--
David Brady
ruby_talk@shinybit.com
C++ Guru. Ruby nuby. Apply salt as needed.

How do I configure Ruby or my (linux) server so that, server wide, it looks in ubygems for modules automatically?

Set RUBYOPT=rubygems in your environment, I believe...

HTH,

Bill

···

From: "David Brady" <ruby_talk@shinybit.com>

install ruby into

   /usr/local/ruby-1.8.3/

so the ruby program is

   /usr/local/ruby-1.8.3/bin/ruby

make a small shell script named

   /usr/local/bin/ruby183

that looks something like

   #! /bin/sh
   RUBYOPT="-r rubygems" /usr/local/ruby-1.8.3/bin/ruby "$@"

also google /etc/environment.

-a

···

On Fri, 11 Nov 2005, David Brady wrote:

According to the Ruby on Rails download page, Gems is "the soon-to-be
official packaging format for Ruby libs/apps".

Putting "ubygems" in the -r value of the command line for every invocation
of Ruby is getting old fast.

How do I configure Ruby or my (linux) server so that, server wide, it looks
in ubygems for modules automatically?

--

ara [dot] t [dot] howard [at] gmail [dot] com
all happiness comes from the desire for others to be happy. all misery
comes from the desire for oneself to be happy.
-- bodhicaryavatara

===============================================================================

I export it from my .bashrc, works like a charm:

export RUBYOPT="rubygems"

While you're there, you can also add the following for nicer ri output:

export RI="--format ansi -T --width 70"

HTH,
Michael

···

On Fri, 11 Nov 2005 16:51:33 +0900 David Brady <ruby_talk@shinybit.com> wrote:

How do I configure Ruby or my (linux) server so that, server wide, it
looks in ubygems for modules automatically?

--
web@citizen428.net citizen428@gentoo.org
http://citizen428.net/ http://dev.gentoo.org/~citizen428/
GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3

this will bite you if you aren't careful. your bashrc is not sourced under
cron, when running remote ssh commands, etc. fyi.

-a

···

On Fri, 11 Nov 2005, Michael Kohl wrote:

On Fri, 11 Nov 2005 16:51:33 +0900 > David Brady <ruby_talk@shinybit.com> wrote:

How do I configure Ruby or my (linux) server so that, server wide, it
looks in ubygems for modules automatically?

I export it from my .bashrc, works like a charm:

export RUBYOPT="rubygems"

While you're there, you can also add the following for nicer ri output:

export RI="--format ansi -T --width 70"

--

ara [dot] t [dot] howard [at] gmail [dot] com
all happiness comes from the desire for others to be happy. all misery
comes from the desire for oneself to be happy.
-- bodhicaryavatara

===============================================================================

I'm aware of that, but you're right, I should probably have mentioned
it. This is from my home machine where I do development work, so I'm
obviously logged in and my .bashrc gets sourced. Given that the topic
starter asked about a server, my answer may not exactly have been what
he was looking for.

···

On Sat, 12 Nov 2005 00:12:28 +0900 "Ara.T.Howard" <ara.t.howard@noaa.gov> wrote:

this will bite you if you aren't careful. your bashrc is not sourced
under cron, when running remote ssh commands, etc. fyi.

--
web@citizen428.net citizen428@gentoo.org
http://citizen428.net/ http://dev.gentoo.org/~citizen428/
GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3