# How to set RUBYLIB path?

**URL:** <https://rubytalk.org/t/how-to-set-rubylib-path/45960>\
**Category:** ruby-talk\
**Created:** [18 April 2008 05:38 UTC](https://rubytalk.org/t/how-to-set-rubylib-path/45960 "2008-04-18T05:38:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Durai](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@Martin\_Durai](https://rubytalk.org/u/Martin_Durai)\
**Post date:** [18 April 2008 05:38 UTC](https://rubytalk.org/t/how-to-set-rubylib-path/45960/1 "2008-04-18T05:38:25Z")

</div>

Dear all,

I was struggling with a problem. I have a product class and a test file  
under Merchant folder. when i run my product class it shows following  
error.

c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem\_original\_require': no such file to load -- builder (LoadError)  
&nbsp;&nbsp;from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require'  
&nbsp;&nbsp;from product.rb:2

I need to set path like set RUBYLIB = ""

i didnt got how to set the path and in which file i have to set or in  
shell prompt? how to set path?

Could any one help me to solve this problem of setting path.

Thanks in advance

Regards,  
Martin

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [18 April 2008 14:56 UTC](https://rubytalk.org/t/how-to-set-rubylib-path/45960/2 "2008-04-18T14:56:47Z")

</div>

maybe gem install builder?  
if not maybe google for 'rubygems path' and 'RUBYLIB environment variable'

> **···**
>
> On Thu, Apr 17, 2008 at 11:38 PM, dare ruby \<martin@angleritech.com\> wrote:
> 
> > Dear all,
> > 
> > I was struggling with a problem. I have a product class and a test file  
> > under Merchant folder. when i run my product class it shows following  
> > error.
> > 
> > c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> > `gem\_original\_require': no such file to load -- builder (LoadError)  
> > &nbsp;&nbsp;from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> > `require'  
> > &nbsp;&nbsp;from product.rb:2
> > 
> > I need to set path like set RUBYLIB = ""
> > 
> > i didnt got how to set the path and in which file i have to set or in  
> > shell prompt? how to set path?
> > 
> > Could any one help me to solve this problem of setting path.
> > 
> > Thanks in advance
> > 
> > Regards,  
> > Martin  
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
> 
> --  
> Find peace [free bible - Google Search](http://www.google.com/search?q=free+bible)

---

<div class="post-metadata">

**Author:** ![Forum](https://avatars.discourse-cdn.com/v4/letter/f/43a26b/32.png) [@Forum](https://rubytalk.org/u/Forum)\
**Post date:** [18 April 2008 16:39 UTC](https://rubytalk.org/t/how-to-set-rubylib-path/45960/3 "2008-04-18T16:39:11Z")

</div>

There are basically three possibilities let us say your library is here:  
/lib/mylibs/mylibrary.rb  
(1)  
setting the variable  
export RUBYLIB="/lib/mylibs/${RUBYLIB:-""}"  
(2)  
using a command line option  
ruby -I/lib/mylib myprog.rb  
(3)  
adjust your $: inside your ruby program  
$:.unshift File.join( %w{ /lib mylib } )

HTH  
Robert

> **···**
>
> On Fri, Apr 18, 2008 at 7:38 AM, dare ruby \<martin@angleritech.com\> wrote:
> 
> > Dear all,
> > 
> > I was struggling with a problem. I have a product class and a test file  
> > under Merchant folder. when i run my product class it shows following  
> > error.
> > 
> > c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> > `gem\_original\_require': no such file to load -- builder (LoadError)  
> > &nbsp;&nbsp;from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> > `require'  
> > &nbsp;&nbsp;from product.rb:2
> > 
> > I need to set path like set RUBYLIB = ""
> > 
> > i didnt got how to set the path and in which file i have to set or in  
> > shell prompt? how to set path?
> > 
> > Could any one help me to solve this problem of setting path.
> > 
> > Thanks in advance
> > 
> > Regards,  
> > Martin  
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
> 
> --  
> [http://ruby-smalltalk.blogspot.com/](http://ruby-smalltalk.blogspot.com/)
> 
> ---  
> Whereof one cannot speak, thereof one must be silent.  
> Ludwig Wittgenstein
