Forum: Ruby Ruby Include Dirs for libs

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.
08e608a2e3fc099dbe59f9ff33dcf9be?d=identicon&s=25 Florian Assmann (Guest)
on 2006-03-14 14:34
(Received via mailing list)
Hi there,

does anybody know which are the default dirs for ruby to search its
..rb's and .so's?

I tried to include postgres-pr but ruby fails finding it. It's residing
in my ruby/gems/1.8/ dir. I don't know it's really installed this way.

Sincerly,

Florian
F1653a5cad4e1859403491de917f8f49?d=identicon&s=25 Bernhard 'elven' Stoeckner (Guest)
on 2006-03-14 14:45
(Received via mailing list)
Florian Assmann scribbled on Tuesday 14 Mar 2006 14:33:

> Florian
elven@avariel ~ $ ruby -e 'puts $:'
/usr/local/lib/site_ruby/1.8
/usr/local/lib/site_ruby/1.8/i486-linux
/usr/local/lib/site_ruby/1.8/i386-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/i486-linux
/usr/lib/ruby/1.8/i386-linux
..
elven@avariel ~ $

Gems is a somewhat different matter:

require 'rubygems'
require_gem 'activerecord'

See also http://docs.rubygems.org/read/chapter/4
10d4acbfdaccb4eee687a428ca00a5d8?d=identicon&s=25 Jim Weirich (weirich)
on 2006-03-14 15:07
Florian Assmann wrote:
> Hi there,
>
> does anybody know which are the default dirs for ruby to search its
> ..rb's and .so's?
>
> I tried to include postgres-pr but ruby fails finding it. It's residing
> in my ruby/gems/1.8/ dir. I don't know it's really installed this way.

If it is in your gems directory, make sure you require rubygems before
requiring the library.  Either do an explicit 'require "rubygems"' in
your code, or make sure that the RUBYOPT environment variable is set to
'rubygems'.

--
-- Jim Weirich
08e608a2e3fc099dbe59f9ff33dcf9be?d=identicon&s=25 Florian Assmann (Guest)
on 2006-03-14 19:31
(Received via mailing list)
Bernhard 'elven' Stoeckner schrieb:

> elven@avariel ~ $ ruby -e 'puts $:'

Ah, nice to know.

> require 'rubygems'
> require_gem 'activerecord'
>
> See also http://docs.rubygems.org/read/chapter/4

Nice to know too, Thanks!

Florian
This topic is locked and can not be replied to.