Where to download FXRuby library; where to put it; RUBYLIB, RUBYPATH env. vars

R

Richard Lionheart

Hi,

I'm just starting to do some GUI using Hal Fulton's excellent intro to
FXRuby in "The Ruby Way". His first example worked "out of the box." (I'm
running ruby 1.8.0 (2003-08-04) [i386-mswin32]). The example required "fox"
and included Fox, but I don't see "fox.rb" anywhere in my Ruby
installation -- only a couple of Fox folders. So what satisfied these
require/include statements?

Second, I ran the next example, which in addition to the fox stuff,
required/included "responder"/Responder. That barfed until I added a fully
qualified path to the RUBYLIB env. var., whereupon the dark clouds
dissipated and the sun shone through. If Ruby found Fox in the prev.
example, why couldn't it find responder.rb in the Fox folder without the
assistance of RUBLIB, suitably initialized?

Third, I've got the fully qualifed path to Ruby/lib in the RUBYLIB var.
also. That's probably redudant, isn't it? Ruby seems to find stuff in
Ruby/lib without that entry in RUBYLIB.

Thanks in advance,
Richad
 
H

Hal Fulton

Richard said:
I'm just starting to do some GUI using Hal Fulton's excellent intro to
FXRuby in "The Ruby Way". His first example worked "out of the box." (I'm
running ruby 1.8.0 (2003-08-04) [i386-mswin32]). The example required "fox"
and included Fox, but I don't see "fox.rb" anywhere in my Ruby
installation -- only a couple of Fox folders. So what satisfied these
require/include statements?

Thanks for the compliment. Most of that section was written by someone
else, as it happens. :)

Be sure to check out the latest docs on fxruby.org, as the book is
rather old with regard to fxruby.

As for the require: Without looking, I guess it's fox.so that it finds.
Second, I ran the next example, which in addition to the fox stuff,
required/included "responder"/Responder. That barfed until I added a fully
qualified path to the RUBYLIB env. var., whereupon the dark clouds
dissipated and the sun shone through. If Ruby found Fox in the prev.
example, why couldn't it find responder.rb in the Fox folder without the
assistance of RUBLIB, suitably initialized?

Hmm, is fox.so in the same dir with responder.rb? My guess is no.
Third, I've got the fully qualifed path to Ruby/lib in the RUBYLIB var.
also. That's probably redudant, isn't it? Ruby seems to find stuff in
Ruby/lib without that entry in RUBYLIB.

I think so.


Hal
 
R

Rich

If you're on Windows (as it looks like you are), then you can just use the
one-click prag-prog installer which will take care of all of the setup for
you (Fox and FXRuby included).

For the one-click installer you could go to
http://rubyforge.org/frs/?group_id=167

-Rich

----- Original Message -----
From: "Richard Lionheart" <[email protected]>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <[email protected]>
Sent: Wednesday, May 19, 2004 9:20 PM
Subject: Where to download FXRuby library; where to put it; RUBYLIB,
RUBYPATH env. vars
 
R

Richard Lionheart

Hi Hal,
Thanks for the compliment. Most of that section was written by someone
else, as it happens. :)

It's well deserved: all the examples that were complete programs ran "out of
the box" once my RUBYLIB was brought up to snuff. Thankfully, they were on
the site you indicated, so I didn't have to key in anything.

Incidentally, I ran all the examples under SciTE, which worked even better
after I changed the line
command.go.*.rb=ruby $(FileNameExt)
in the Ruby.properties file to use rubyw rather than ruby. I consulted one
of the maintainers of SciTE about my change and have yet to receive his
"blessing," but it works well for me in that no spurious Command window is
opened as I run these GUI apps (and non-GUI apps still run correctly.)
As for the require: Without looking, I guess it's fox.so that it finds.

Sounds plausible. It's the only fox.??? file in the Ruby installation.
It's tucked away in Ruby\lib\ruby\site_ruby\1.8\i386-msvcrt, which the Ruby
interpreter knows implicitly, apparently.
Be sure to check out the latest docs on fxruby.org, as the book is
rather old with regard to fxruby.

THANKS. That was going to be my next question as I saw your references to
other widgets. I had poked around on Google earlier but did not see that
site recommended in response to my queries.
Second, I ran the next example, which in addition to the fox stuff,
required/included "responder"/Responder. That barfed until I added a fully
qualified path to the RUBYLIB env. var.,[snip]
Hmm, is fox.so in the same dir with responder.rb? My guess is no.

Correct. fox.so's location is given above. responder.rb is in
Ruby\site_ruby\1.8\fox.
I think so.

Great. I'll clean that up.

Best wishes,
Richard
 
R

Richard Lionheart

Hi Rich,

Thanks for the response. Now that I've got all the FXRuby stuff from Hal's
book working, I think my installation might be fine ... the main problem is
I didn't understand how the require/rubylib scheme fit together (and that
"require fox" is satisfied by fox.so in the bowel of the Ruby installation.)
So it appears that FXRuby is installed on my system.
If you're on Windows (as it looks like you are), then you can just use the
one-click prag-prog installer which will take care of all of the setup for
you (Fox and FXRuby included).
For the one-click installer you could go to
http://rubyforge.org/frs/?group_id=167

Thanks for the link. It appears that the original developent effort for
this tool was on SourceForge but has moved to RubyForge.

I think I downloaded a zip file from SourceForge and installed simply by
extracting into a suitable directory. Since I manually unzipped, my
environment was not set up properly. Now with RUBYLIB set to
Ruby\site_ruby\1.8\fox, things seem to be smoothe.

Do you think I can gain much by wiping out my installation and using the
installer from RubyForge?

Best wishes,
Richard
 
R

Richard Lionheart

Hi Lyle,

Hi Lyle,

Thanks for your posts.

What I had (which worked) was:

RUBYLIB = I:\Program Files\Ruby\lib\ruby\site_ruby\1.8\fox

and

require "responder"

As I understand your advice, which I've tried and it works (as you
expected), is to drop \fox from the first and prefix fox/ in the latter.
(BTW, prefixing fox\ does NOT work, despite the fact I running Win2000Pro
.... it looks like the conversion from \ to / happens when the environment is
first accessed.)

It seems to me that the rationale underlying your approach is that I can
equally well reference other packages parallel to the fox folder without
changing RUBYLIB each time.

I'd like to check one other issue: in your judgement, what's the purpose
of the initial 'require "fox"' statement. Hal speculated it references the
fox.so library (interesting, a Unix extension in a Windows environment) and
that the interpreter has a built-in path to it (its located in
Ruby\lib\ruby\site_ruby\1.8\i386-msvcrt).

Again, thanks for your insights.

Regards,
Richard
 
R

Richard Lionheart

Hi Lyle,

I just downloaded a neat FXRuby package, ListView, from
http://www.netpromi.com/listview.html. It came with a sample app using it.
I thought I might make use of it later, so I peeled off the example into an
Examples\Ruby subdir and the pkg's files in the folder Ruby\lib\listview.

But that seems wrong because it might get wiped out when Ruby is updated.
On the other hand, it looks like Ruby updates will go into Ruby\1.9 and
Ruby\lib\ruby\site_ruby\1.9, for example, and thus not touch Ruby\lib.

Do you have an opinion?

Regards,
Richard
 
R

Richard Lionheart

Hi Lyle,

Thanks for these add'l details. There were so many responses on this thread
that I missed this particular post until I checked back today.

Again, thanks for all your insights.

Regards,
Richard
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top