[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

relocatable ruby distribution

fkc_email-news @ yahoo dot com

4/30/2007 11:07:00 PM

Hi All:

I've convinced the java project to allow ruby (yay!), and now we
want to include and control the ruby dist, libraries and gems and all
in svn. Since the project can be checked out anywhere I want to be
able to relocate ruby. I tried allinoneruby (happily used ruby2exe on
a different project), and can't figure out how to get it to include
all the libs and gems. I also tried to point $: at the correct
locations, but got an unresolved lib.

Is there a std way to do this?

Thanks

Forrest

18 Answers

fkc_email-news @ yahoo dot com

4/30/2007 11:39:00 PM

0

I should also point out we're running RHEL4 64 bit, though we want to
move to running windows builds as well.

Thanks in advance

Forrest

brabuhr

5/2/2007 1:15:00 AM

0

On 4/30/07, fkc_email-news @ yahoo dot com <fkchang2000@gmail.com> wrote:
> Hi All:
> I've convinced the java project to allow ruby (yay!), and now we
> want to include and control the ruby dist, libraries and gems and all
> in svn. Since the project can be checked out anywhere I want to be
> able to relocate ruby. I tried allinoneruby (happily used ruby2exe on
> a different project), and can't figure out how to get it to include
> all the libs and gems. I also tried to point $: at the correct
> locations, but got an unresolved lib.

What was your error? A quick test seems to indicate that hijacking $:
works:

> /opt/bin/ruby -e 'puts $:; require "rubygems"'
/opt/lib/ruby/site_ruby/1.8
/opt/lib/ruby/site_ruby/1.8/i686-linux
/opt/lib/ruby/site_ruby
/opt/lib/ruby/1.8
/opt/lib/ruby/1.8/i686-linux

brabuhr

5/3/2007 1:17:00 AM

0

On 4/30/07, fkc_email-news @ yahoo dot com <fkchang2000@gmail.com> wrote:
> I've convinced the java project to allow ruby (yay!), and now we
> want to include and control the ruby dist, libraries and gems and all
> in svn. Since the project can be checked out anywhere I want to be
> able to relocate ruby. I tried allinoneruby (happily used ruby2exe on
> a different project), and can't figure out how to get it to include
> all the libs and gems. I also tried to point $: at the correct
> locations, but got an unresolved lib.
>
> Is there a std way to do this?

Check out:
http://developers.j...
it looks like they build a tree with the ruby binaries and libraries and
have a script to override the environment to point to that version of
Ruby.

Richard Conroy

5/3/2007 10:13:00 AM

0

On 5/1/07, Logan Capaldo <logancapaldo@gmail.com> wrote:
> On 4/30/07, fkc_email-news @ yahoo dot com <fkchang2000@gmail.com> wrote:
> > Is there a std way to do this?
>
> Seems like, since you are already using java, that it would be better to use
> jruby. http://jruby.cod...

Yes I second that. JRuby has some excellent features, but one of the nicest
for a Java shop is that you can bundle Ruby code in java containers (jar/war).
Which I think would really help the OP, if he wants a convenient way to
organise the Ruby elements under SVN.

Though I have to wonder about about storing the Ruby runtime - thats kind of
overkill isn't it?

OT: This brings me to an issue that I have been pondering for some time:
- what is the minimum (file size) configuration of a Ruby Runtime install?

I recently did a portable apps install of Ruby onto my usb drive, but it was
formatted as FAT so all those little files ended up taking huge amounts of
space (The Ruby Runtime takes over 1.2 GB of the usb drive). Admittedly
there were quite a few gems installed there too.

What can be safely deleted? The RDoc & RI stuff comes to mind (I would
hate to be offline if I needed them .... but RI takes 200MB on its own)

Charles Oliver Nutter

5/3/2007 1:08:00 PM

0

Richard Conroy wrote:
> On 5/1/07, Logan Capaldo <logancapaldo@gmail.com> wrote:
>> On 4/30/07, fkc_email-news @ yahoo dot com <fkchang2000@gmail.com> wrote:
>> > Is there a std way to do this?
>>
>> Seems like, since you are already using java, that it would be better
>> to use
>> jruby. http://jruby.cod...
>
> Yes I second that. JRuby has some excellent features, but one of the nicest
> for a Java shop is that you can bundle Ruby code in java containers
> (jar/war).
> Which I think would really help the OP, if he wants a convenient way to
> organise the Ruby elements under SVN.
>
> Though I have to wonder about about storing the Ruby runtime - thats
> kind of
> overkill isn't it?
>
> OT: This brings me to an issue that I have been pondering for some time:
> - what is the minimum (file size) configuration of a Ruby Runtime install?

With no gems and no docs included, we have a "jruby-complete" jar file
that has the full JRuby runtime plus the standard libraries we support
(most of them) that's around 3MB. Not too shabby for a complete Ruby
interpreter.

java -jar jruby-complete.jar -e "puts 'hello'"

- Charlie


Richard Conroy

5/4/2007 3:14:00 PM

0

On 5/3/07, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
> Richard Conroy wrote:
> > OT: This brings me to an issue that I have been pondering for some time:
> > - what is the minimum (file size) configuration of a Ruby Runtime install?
>
> With no gems and no docs included, we have a "jruby-complete" jar file
> that has the full JRuby runtime plus the standard libraries we support
> (most of them) that's around 3MB. Not too shabby for a complete Ruby
> interpreter.

Niiice. Didn't think it would go that low. Its not what I expected, but getting
it *that* lean has implications for say getting a DSL into a Java app. I know
in our line of work the size of the Java runtime is always an issue.

Any resources on trimming the non-essentials? Considering that I *do*
wish to use gems and such. Its one thing to trim out docs & non-essentials
from the 1-click, but I would probably need to install local gems and stuff.

Might be nice if there was a Rake task to do this all.

> java -jar jruby-complete.jar -e "puts 'hello'"

Hmmm ... I am going to have to start messing with JRuby pretty hardcore -
it would map well to some of the Camping I am doing now.

Charles Oliver Nutter

5/5/2007 4:52:00 AM

0

Richard Conroy wrote:
> Any resources on trimming the non-essentials? Considering that I *do*
> wish to use gems and such. Its one thing to trim out docs & non-essentials
> from the 1-click, but I would probably need to install local gems and
> stuff.

Gems are a bit tricky, since they want to be loose on the filesystem and
we don't (yet) have a way to fake Ruby's "File" class to work from
within a JAR file. You could get around it by installing the gem
contents directly, I suppose. We'll have a better answer here in the
future (post 1.0).

> Might be nice if there was a Rake task to do this all.

Yes, that would be very nice, and it's a good idea. In general though
you's currently have to trim it yourself. Of course the "complete" JAR
is just a zip file, so you could unpack, delete, repack and get the same
results. I've done this to trim it down to just have IRB included, which
lowers the total size to more like 1.6MB. With better compression
(pack200 for example) it could be even smaller.

>> java -jar jruby-complete.jar -e "puts 'hello'"
>
> Hmmm ... I am going to have to start messing with JRuby pretty hardcore -
> it would map well to some of the Camping I am doing now.

Last I'd heard, Camping works well in JRuby.

- Charlie

fkc_email-news @ yahoo dot com

5/18/2007 8:50:00 AM

0


> > all the libs and gems. I also tried to point $: at the correct
> > locations, but got an unresolved lib.
>
> What was your error? A quick test seems to indicate that hijacking $:
> works:
>
> > /opt/bin/ruby -e 'puts $:; require "rubygems"'
>
> /opt/lib/ruby/site_ruby/1.8
> /opt/lib/ruby/site_ruby/1.8/i686-linux
> /opt/lib/ruby/site_ruby
> /opt/lib/ruby/1.8
> /opt/lib/ruby/1.8/i686-linux

I'm away from my system at work (at RailsConf), but if I recall, it
has to do with C based extensions that I compiled.

I'd make a guess that the c libs are trying to link to libs that are
now not where they were when they were compiled. Thus the unresolved
lib errors.

Dunno if I tried to manipulate LD_LIBRARY_PATH, mebbe that's it.
Maybe I'll try that when I get back.

fkc_email-news @ yahoo dot com

5/18/2007 8:57:00 AM

0

On May 3, 3:12 am, "Richard Conroy" <richard.con...@gmail.com> wrote:
> On 5/1/07, Logan Capaldo <logancapa...@gmail.com> wrote:
>
> > On 4/30/07, fkc_email-news @ yahoo dot com <fkchang2...@gmail.com> wrote:
> > > Is there a std way to do this?
>
> > Seems like, since you are already using java, that it would be better to use
> > jruby.http://jruby.cod...
>
> Yes I second that. JRuby has some excellent features, but one of the nicest
> for a Java shop is that you can bundle Ruby code in java containers (jar/war).
> Which I think would really help the OP, if he wants a convenient way to
> organise the Ruby elements under SVN.
>

My problem is the already developed apps use a number of C extension/c
library backed apps, so w/o needing to create substitute libs to be
able run under jruby isn't in the cards.

However, I've already added jruby to our dists and have extended ant
to support jruby scripting, and plan to leverage jruby in other
situations.

Jim Weirich was telling about Charles and Tom's (hi guys) tutorial
this morning and the way he described them deploying to mongrel, then
glassfish, then hot refresh under glassfish seems quite promising. I
used JRuby about 2.5 years ago on a project that needed to communicate
w/JMS, JRuby has come quite a ways since then.

> Though I have to wonder about about storing the Ruby runtime - thats kind of
> overkill isn't it?
>

It's all about configuration mgmt - ensuring that we have the same env
anywhere we deploy got my gems and extensions that I need.

Renia

6/14/2009 9:42:00 PM

0

test