# Undefined method \`require\_gem' for main:Object (NoMethodErro

**URL:** <https://www.ruby-forum.com/t/undefined-method-require-gem-for-main-object-nomethoderro/142246>\
**Category:** Rails\
**Created:** [July 5, 2008, 5:43am UTC](https://www.ruby-forum.com/t/undefined-method-require-gem-for-main-object-nomethoderro/142246 "2008-07-05T05:43:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuhin\_cse99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@tuhin\_cse99](https://www.ruby-forum.com/u/tuhin_cse99)\
**Post date:** [July 5, 2008, 5:43am UTC](https://www.ruby-forum.com/t/undefined-method-require-gem-for-main-object-nomethoderro/142246/1 "2008-07-05T05:43:55Z")

</div>

Hi guys,

In my fedora 9 system i have installed  
ruby 1.86,  
actionmailer (2.1.0)  
actionpack (2.1.0)  
activerecord (2.1.0)  
activeresource (2.1.0)  
activesupport (2.1.0)  
cgi\_multipart\_eof\_fix (2.5.0)  
daemons (1.0.10)  
fastthread (1.0.1)  
gem\_plugin (0.2.3)  
mongrel (1.1.5)  
rails (2.1.0)  
rake (0.8.1)  
rubygems-update (1.2.0)  
sources (0.0.1)

But while creating a test rails application it shows the problem  
[root@localhost bin]# rails testapp  
/usr/bin/rails:17: undefined method `require\_gem’ for main:Object  
(NoMethodError)

Please give a idea to solve that.

Eros

---

<div class="post-metadata">

**Author:** ![tuhin\_cse99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@tuhin\_cse99](https://www.ruby-forum.com/u/tuhin_cse99)\
**Post date:** [July 5, 2008, 12:47pm UTC](https://www.ruby-forum.com/t/undefined-method-require-gem-for-main-object-nomethoderro/142246/2 "2008-07-05T12:47:26Z")

</div>

On Jul 5, 4:43 am, Ruhul A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> But while creating a test rails application it shows the problem  
> [root@localhost bin]# rails testapp  
> /usr/bin/rails:17: undefined method `require\_gem’ for main:Object  
> (NoMethodError)

It sounds like /usr/bin/rails (which is really just a stub that loads  
some gems) is really old (or created by an old version of rubygems).  
I’d try deleting it and reinstalling.

Fred
