# ...rubygems... in require: no such file to load

**URL:** <https://rubytalk.org/t/rubygems-in-require-no-such-file-to-load/23114>\
**Category:** ruby-talk\
**Created:** [8 December 2005 13:41 UTC](https://rubytalk.org/t/rubygems-in-require-no-such-file-to-load/23114 "2005-12-08T13:41:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wybo\_Dekker](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@Wybo\_Dekker](https://rubytalk.org/u/Wybo_Dekker)\
**Post date:** [8 December 2005 13:41 UTC](https://rubytalk.org/t/rubygems-in-require-no-such-file-to-load/23114/1 "2005-12-08T13:41:05Z")

</div>

I have a script requiring rubygems, rio, and more, plus a module in a  
non-standard directory. It works fine on my machine, but not on the  
machine of a friend.

Here's the important part of my module  
&nbsp;&nbsp;&nbsp;&nbsp;require 'session'  
&nbsp;&nbsp;&nbsp;&nbsp;require 'rubygems'  
&nbsp;&nbsp;&nbsp;&nbsp;require 'term/ansicolor'

&nbsp;&nbsp;&nbsp;&nbsp;class String  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include Term::ANSIColor  
&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;module TestMe  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def sys(command)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;end # TestMe

It is stored in /home/local/ruby/testme.rb  
And this is the calling script:

&nbsp;&nbsp;&nbsp;&nbsp;#!/usr/bin/ruby  
&nbsp;&nbsp;&nbsp;&nbsp;puts 'LOAD\_PATH:',$LOAD\_PATH.join("\n")  
&nbsp;&nbsp;&nbsp;&nbsp;puts 'RUBYLIB:',ENV['RUBYLIB']  
&nbsp;&nbsp;&nbsp;&nbsp;puts 'RUBYOPT:',ENV['RUBYOPT']  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;require 'rubygems'  
&nbsp;&nbsp;&nbsp;&nbsp;require 'rio'  
&nbsp;&nbsp;&nbsp;&nbsp;require 'testme'  
&nbsp;&nbsp;&nbsp;&nbsp;include TestMe  
&nbsp;&nbsp;&nbsp;&nbsp;sys('ls')  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;puts rio('/etc/passwd').gets

&nbsp;&nbsp;&nbsp;&nbsp;\>testme  
&nbsp;&nbsp;&nbsp;&nbsp;LOAD\_PATH:  
&nbsp;&nbsp;&nbsp;&nbsp;.  
&nbsp;&nbsp;&nbsp;&nbsp;/home/local/ruby  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.8  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.8/i686-linux  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.8  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.8/i686-linux  
&nbsp;&nbsp;&nbsp;&nbsp;.  
&nbsp;&nbsp;&nbsp;&nbsp;RUBYLIB:  
&nbsp;&nbsp;&nbsp;&nbsp;.:/home/local/ruby  
&nbsp;&nbsp;&nbsp;&nbsp;RUBYOPT:  
&nbsp;&nbsp;&nbsp;&nbsp;nil  
&nbsp;&nbsp;&nbsp;&nbsp;system call: ls successful  
&nbsp;&nbsp;&nbsp;&nbsp;root:x:0:0:root:/home/root:/bin/bash  
&nbsp;&nbsp;&nbsp;&nbsp;\>

But on the friend's machine (who stores the module in  
/home/rrt/local/lib/site\_ruby/1.8):

&nbsp;&nbsp;&nbsp;&nbsp;\>testme  
&nbsp;&nbsp;&nbsp;&nbsp;LOAD\_PATH:  
&nbsp;&nbsp;&nbsp;&nbsp;/home/rrt/local/lib/site\_ruby/1.8/i386-linux  
&nbsp;&nbsp;&nbsp;&nbsp;/home/rrt/local/lib/site\_ruby/1.8  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/site\_ruby/1.8  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/site\_ruby/1.8/i386-linux  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/site\_ruby  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/lib/ruby/1.8  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/lib/ruby/1.8/i386-linux  
&nbsp;&nbsp;&nbsp;&nbsp;.  
&nbsp;&nbsp;&nbsp;&nbsp;RUBYLIB:  
&nbsp;&nbsp;&nbsp;&nbsp;/home/rrt/local/lib/site\_ruby/1.8/i386-linux:/home/rrt/local/lib/site\_ruby/1.8  
&nbsp;&nbsp;&nbsp;&nbsp;RUBYOPT:  
&nbsp;&nbsp;&nbsp;&nbsp;nil  
&nbsp;&nbsp;&nbsp;&nbsp;/usr/lib/ruby/1.8/rubygems/custom\_require.rb:26:in `require': No such file  
&nbsp;&nbsp;&nbsp;&nbsp;to load -- testme (LoadError)  
&nbsp;&nbsp;&nbsp;&nbsp;from ./testme:8

What's wrong? Something with the rubygems installation?

> **···**
>
> On my machine it successfully says:
> 
> --  
> Wybo

---

<div class="post-metadata">

**Author:** ![Jim\_Weirich1](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@Jim\_Weirich1](https://rubytalk.org/u/Jim_Weirich1)\
**Post date:** [8 December 2005 15:58 UTC](https://rubytalk.org/t/rubygems-in-require-no-such-file-to-load/23114/2 "2005-12-08T15:58:54Z")

</div>

wybo wrote:

> I have a script requiring rubygems, rio, and more, plus a module in a  
> non-standard directory. It works fine on my machine, but not on the  
> machine of a friend.

[...]

> &nbsp;&nbsp;&nbsp;&nbsp;/usr/lib/ruby/1.8/rubygems/custom\_require.rb:26:in `require': No  
> such file  
> &nbsp;&nbsp;&nbsp;&nbsp;to load -- testme (LoadError)  
> &nbsp;&nbsp;&nbsp;&nbsp;from ./testme:8
> 
> What's wrong? Something with the rubygems installation?

(1) Double check that testme is truely installed in the  
/home/rrt/local/lib/site\_ruby/1.8.

(2) Make sure the file can be loaded correctly.

Try soemthing like this to see if it sheds any light:

&nbsp;&nbsp;&nbsp;load '/home/rrt/local/lib/site\_ruby/1.8/testme.rb'

-- Jim Weirich

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

---

<div class="post-metadata">

**Author:** ![Wybo\_Dekker](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@Wybo\_Dekker](https://rubytalk.org/u/Wybo_Dekker)\
**Post date:** [10 December 2005 10:00 UTC](https://rubytalk.org/t/rubygems-in-require-no-such-file-to-load/23114/3 "2005-12-10T10:00:00Z")

</div>

Thanks, Jim. This helped: we finally found out that the session gem wasn't  
installed, but another session.rb was loaded instead.

> **···**
>
> On Fri, 9 Dec 2005, Jim Weirich wrote:
> 
> > wybo wrote:  
> > \> I have a script requiring rubygems, rio, and more, plus a module in a  
> > \> non-standard directory. It works fine on my machine, but not on the  
> > \> machine of a friend.  
> > \>  
> > [...]  
> > \> /usr/lib/ruby/1.8/rubygems/custom\_require.rb:26:in `require': No  
> > \> such file  
> > \> to load -- testme (LoadError)  
> > \> from ./testme:8  
> > \>  
> > \> What's wrong? Something with the rubygems installation?
> > 
> > (1) Double check that testme is truely installed in the  
> > /home/rrt/local/lib/site\_ruby/1.8.
> > 
> > (2) Make sure the file can be loaded correctly.
> > 
> > Try soemthing like this to see if it sheds any light:
> > 
> > &nbsp;&nbsp;&nbsp;load '/home/rrt/local/lib/site\_ruby/1.8/testme.rb'
> 
> --  
> Wybo
