[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby CLASSPATH

Slaine

2/14/2009 9:55:00 AM

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,



4 Answers

matt

2/14/2009 6:11:00 PM

0

Slaine <lennart.benoot@gmail.com> wrote:

> 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?

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, phd = matt@tidbits.com, http://www.tidbits...
Leopard - http://www.takecontrolbooks.com/leopard-custom...
AppleScript - http://www.amazon.com/gp/product/...
Read TidBITS! It's free and smart. http://www.t...

Jeff Moore

2/14/2009 6:24:00 PM

0

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...



--
Posted via http://www.ruby-....

matt

2/14/2009 7:57:00 PM

0

Jeff Moore <jcmoore@pressenter.com> wrote:

> 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...

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.

--
matt neuburg, phd = matt@tidbits.com, http://www.tidbits...
Leopard - http://www.takecontrolbooks.com/leopard-custom...
AppleScript - http://www.amazon.com/gp/product/...
Read TidBITS! It's free and smart. http://www.t...

Slaine

2/15/2009 7:53:00 PM

0

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,