Hi,

  In mail "Re: installing mod_ruby --> seg fault in ruby-rdtool"
    "Craig Burgess" <craig / CheetahUSA.net> wrote:

> Thank you for the guidance. Now my ignorance is going to show. I couldn't
> make the change to the racc file because I  couldn't find the string in the
> file. There was no reference in racc to "architecture" or "i686."  I must be
> missing something. Here is all that I could find which included "path"

Don't mind. My description was insufficient.
Here is the full description:

  * Ruby searches libraries from its "load path".

  * Ruby's load path is held in the $: (global variable).
    It is an array of strings. You can display your ruby's
    load path like this:

        $ ruby -e 'puts $:'

    On my linux box, this command prints these lines:

        /usr/local/lib/ruby/site_ruby/1.6
        /usr/local/lib/ruby/site_ruby/1.6/i686-linux
        /usr/local/lib/ruby/site_ruby
        /usr/local/lib/ruby/1.6
        /usr/local/lib/ruby/1.6/i686-linux
        .

  * Ruby loads ruby extentions (ruby libraries which are written in C)
    from same load pathes too, but by default, all extentions are placed
    under the specific directories, such as "/usr/local/lib/ruby/1.6/i686-linux".
    I call it "architecture-dependent library path" (I call it ARCH path).
    You can get your architecture name by this command:

        $ ruby -r rbconfig -e 'puts Config::CONFIG["arch"]'

    On my linux box, this command prints this line:

        i686-linux

    Now I know my ARCH path is /usr/local/lib/ruby/site_ruby/1.6/i686-linux
    and /usr/local/lib/ruby/1.6/i686-linux.

  * Racc command (it may be /usr/local/bin/racc) is a ruby script,
    so racc also searches its libraries from ruby's load path.

  * Now I assume that your problem is caused by racc's ruby extentions.

  * Racc can run without ruby extentions, bacause it have both of
    ruby version code and C version code.

  * Then, if racc works well without extentions, we can know that
    the problem is in racc's extention. (ruby does not have any problems)

  * Racc uses ruby version library when it fails to load ruby extentions.

  * So removing ARCH pathes from ruby's load path results in racc uses
    ruby version libraries. *I* can do this by following script:

        $:.delete_if {|path| /i686-linux/ === path }

    But "i686-linux" is different on your host, bacause ARCH path is
    architecture dependent. So you must replace "i686-linux" by your
    architecture name.

  * Note that we must remove ARCH pathes in racc process itself,
    before racc loads its extention libraries. Then we must
    put above code in the beginning of the racc command file
    (/usr/local/bin/racc).

    I do not say "we must put code in the FIRST LINE" because
    there's #! line. Second line is OK.


> Unable to execute step #1, I moved on to attempt step #2.  Nothing
> happened - should there have been some kind of result?
> 
> felix# ruby test.rb
> felix#

Nothing happen is OK. This is a good result. It seems that ruby is
innocent. Maybe racc's extention is wrong.

-- Minero Aoki