Putting -r ubygems in the path permanently?

D

David Brady

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
 
B

Bill Kelly

From: "David Brady said:
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
 
A

Ara.T.Howard

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?

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

Michael Kohl

--Signature_Fri__11_Nov_2005_15_47_29_+0100_xLS_+qlEbVDrU/R7
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

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

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

export RUBYOPT=3D"rubygems"

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

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

HTH,
Michael

--=20
(e-mail address removed) (e-mail address removed)
http://citizen428.net/ http://dev.gentoo.org/~citizen428/
GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3

--Signature_Fri__11_Nov_2005_15_47_29_+0100_xLS_+qlEbVDrU/R7
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDdK8EZgSmR+etHJoRAi1dAKDKP02N5XBTzfozdLg7ixT60ZvV0ACfQIWD
bQpsSbTx29Oz4vzlDADbyww=
=vuqZ
-----END PGP SIGNATURE-----

--Signature_Fri__11_Nov_2005_15_47_29_+0100_xLS_+qlEbVDrU/R7--
 
A

Ara.T.Howard

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"

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

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

Michael Kohl

--Signature_Sat__12_Nov_2005_15_40_24_+0100_rR98fpn/_fGDGJV_
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

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

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.

--=20
(e-mail address removed) (e-mail address removed)
http://citizen428.net/ http://dev.gentoo.org/~citizen428/
GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3

--Signature_Sat__12_Nov_2005_15_40_24_+0100_rR98fpn/_fGDGJV_
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDdf7bZgSmR+etHJoRAhw1AJ9ZhJ6HPB2emmA9OO/d9J3JF60YIwCePeqC
6Dp2PSJ+wBtaC4k42ehz/0I=
=a86m
-----END PGP SIGNATURE-----

--Signature_Sat__12_Nov_2005_15_40_24_+0100_rR98fpn/_fGDGJV_--
 

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
474,196
Messages
2,571,036
Members
47,631
Latest member
kukuh

Latest Threads

Top