Ruby CLASSPATH

Hi all,

I have upgraded ruby on a Amazon EC2 instance. I trying to bundle it
now using the ruby program packaged with the AMI.
There seems to be something wrong now with loading required libraries.
When the main ruby program tries to load the first library I get the
following error :
`require’: no such file to load – ec2/amitools/bundle (LoadError)

This file is located in folder: /usr/lib/site_ruby/ec2/amitools/bundle

There seems to be something wrong with the path where ruby tries to
find external folders. Does anyone have any idea how I could add it?

Thanks for your help

BR,

Slaine [email protected] wrote:

There seems to be something wrong with the path where ruby tries to
find external folders. Does anyone have any idea how I could add it?

You can modify $: in your code before the require (it’s an array, just
append to it). If this is to be a more permanent change you can modify
your environment’s RUBYLIB.

m.

matt neuburg wrote:

Slaine [email protected] wrote:

There seems to be something wrong with the path where ruby tries to
find external folders. Does anyone have any idea how I could add it?

You can modify $: in your code before the require (it’s an array, just
append to it). If this is to be a more permanent change you can modify
your environment’s RUBYLIB.

m.

In the same vain you can run this:

ruby -e ‘p $:’

To obtain the paths currently being searched…

Jeff M. [email protected] wrote:

m.

In the same vain you can run this:

ruby -e ‘p $:’

To obtain the paths currently being searched…

Unless $: has already been altered by the load system. For example, on
Mac OS X using TextMate, saying ruby -e ‘p $:’ and asking for $: in code
will give two very different answers. So I recommend doing the latter.

m.

Hi all,

Thanks for the suggestions. I have solved the issue by setting:

RUBYLIB=/usr/lib/site_ruby:/usr/lib/ruby/1.8

Afterwards there was still something wrong with reading openssl.so. I
solved this by manually adding a symbolic link in /usr/lib to /usr/
lib/ruby/1.8/i386-linux/openssl.so

Then, I apparently had to run the ec2-bundle tool from /usr/lib in
order to make it work.
Not a entirely elegant solution but it works for now.

BR,