Ruby Include Dirs for libs

F

Florian Assmann

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
 
B

Bernhard 'elven' Stoeckner

Florian Assmann scribbled on Tuesday 14 Mar 2006 14:33:
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

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
 
J

Jim Weirich

Florian said:
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'.
 

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,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top