Forum: Ruby Ruby CLASSPATH

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.
A8604c149c59916ac64e19874f99933b?d=identicon&s=25 Slaine (Guest)
on 2009-02-14 10:55
(Received via mailing list)
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,
Fbb4d027695dfdf76bf448b15d7e306a?d=identicon&s=25 matt neuburg (Guest)
on 2009-02-14 19:15
(Received via mailing list)
Slaine <lennart.benoot@gmail.com> 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.
C1b6b5557723c9db912b075e954166d3?d=identicon&s=25 Jeff Moore (djief)
on 2009-02-14 19:25
matt neuburg wrote:
> Slaine <lennart.benoot@gmail.com> 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...
Fbb4d027695dfdf76bf448b15d7e306a?d=identicon&s=25 matt neuburg (Guest)
on 2009-02-14 21:06
(Received via mailing list)
Jeff Moore <jcmoore@pressenter.com> 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.
A8604c149c59916ac64e19874f99933b?d=identicon&s=25 Slaine (Guest)
on 2009-02-15 20:55
(Received via mailing list)
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,
This topic is locked and can not be replied to.