# Include core class extensions

**URL:** <https://www.ruby-forum.com/t/include-core-class-extensions/90327>\
**Category:** Ruby\
**Created:** [March 27, 2007, 9:33pm UTC](https://www.ruby-forum.com/t/include-core-class-extensions/90327 "2007-03-27T21:33:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sparkle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sparkle](https://www.ruby-forum.com/u/sparkle)\
**Post date:** [March 27, 2007, 9:33pm UTC](https://www.ruby-forum.com/t/include-core-class-extensions/90327/1 "2007-03-27T21:33:20Z")

</div>

An internal application, the “manager”, will periodically locate a  
series of ruby files in a directory structure. The application will  
execute each ruby file using backticks (e.g. `ruby myfile.rb`). This  
means that a single execution of the manager may end up spinning a  
number of separate ruby processes. Although there are clear issues with  
this, it is working well enough.

Now we need to include some core class extensions in each ruby process  
this application spins up. The files that the manager will run do not  
know about the extensions.

I have tried variations of the following interpreter options will no  
success (probably user error):

-rlibrary require the library, before executing your script  
-Idirectory specify $LOAD\_PATH directory (may be used more than  
once)

How, can I force each ruby process to “require” these class extensions?

thanks in advance.

Carlos

---

<div class="post-metadata">

**Author:** ![sparkle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sparkle](https://www.ruby-forum.com/u/sparkle)\
**Post date:** [March 28, 2007, 1:20am UTC](https://www.ruby-forum.com/t/include-core-class-extensions/90327/2 "2007-03-28T01:20:29Z")

</div>

On Mar 27, 1:33 pm, Carlos F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have tried variations of the following interpreter options will no  
> success (probably user error):
> 
> -rlibrary require the library, before executing your script  
> -Idirectory specify $LOAD\_PATH directory (may be used more than  
> once)

Perhaps a few more details would help. What about them failed? How did  
they fail? Where are your libraries installed, or are you only talking  
about items in the Standard Library[1]? What values did you use for  
directory, and where is your ruby lib installed? What OS are you on?

[1] [http://ruby-doc.org/stdlib/](http://ruby-doc.org/stdlib/)

---

<div class="post-metadata">

**Author:** ![sparkle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sparkle](https://www.ruby-forum.com/u/sparkle)\
**Post date:** [March 28, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/include-core-class-extensions/90327/3 "2007-03-28T16:41:03Z")

</div>

Gavin,

sorry that my question was so vague. between lack of sleep and not  
knowing really want to ask I didn’t provide enough for you to go on.

I solved my issue last night as soon as put a decent amount of distance  
between me and my computer.

I was specifying the “-I” as a relative path, but the rest of the  
command: "c:\tools\ruby\bin\ruby.exe . . . " was specified using  
absolute paths. At that point, I wasn’t even sure what the relative  
path, would be relative to? The original process, or the new process.  
As soon as i specified “-I” in absolute terms it worked as expected.

One last . . . semi-related question. Is the file specified with the -r  
switch, as well as all files specified with “require”, considered  
relative to a dir on the $LOAD\_PATH if it does not start with a ‘/’?

Carlos
