# Undefined method \`gem' for main:Object (NoMethodError)

**URL:** <https://www.ruby-forum.com/t/undefined-method-gem-for-main-object-nomethoderror/86098>\
**Category:** Rails\
**Created:** [February 19, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/undefined-method-gem-for-main-object-nomethoderror/86098 "2007-02-19T21:44:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 19, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/undefined-method-gem-for-main-object-nomethoderror/86098/1 "2007-02-19T21:44:47Z")

</div>

fiercefe@sh113 [~/public\_html/ruby\_test]# ruby script/server  
./script/…/config/boot.rb:29: undefined method `gem’ for main:Object  
(NoMethodError)  
from script/server:2

I did: rails ruby\_test

then I tried to create a controller as shown above and incurred  
errors, wondering if you know what’s wrong. Additionally I can’t run  
the command: ruby script/server to start the server on the ruby  
folder.

Any idea what to do from here? Should I contact my hosting?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 19, 2007, 9:56pm UTC](https://www.ruby-forum.com/t/undefined-method-gem-for-main-object-nomethoderror/86098/2 "2007-02-19T21:56:49Z")

</div>

I think you need to start your webserver from the application root  
directory.

hth,  
Bill

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 19, 2007, 10:17pm UTC](https://www.ruby-forum.com/t/undefined-method-gem-for-main-object-nomethoderror/86098/3 "2007-02-19T22:17:53Z")

</div>

2007/2/19, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> the command: ruby script/server to start the server on the ruby  
> folder.
> 
> Any idea what to do from here? Should I contact my hosting?

You’ve got Rails 1.2.2 and Rubygems \< 0.9.0, and gem  
replaces require\_gem method (see :

> **[Rails 1.2.2: SQLite3, gems, singular resources](https://rubyonrails.org/2007/2/6/rails-1-2-2-sqlite3-gems-singular-resources)**
>
> It’s time for another minor update to Rails 1.2. This was primarily prompted by a change in the API for SQLite between version 3.3.7 and 3.3.8+, which left the Rails database adapter for dead by the road side. But with this release and Jamis Buck’s...

). So downgrade Rails or upgrade RubyGems.

– Jean-François.

–  
Ruby ( [http://www.rubyfrance.org](http://www.rubyfrance.org) ) on Rails ( [http://www.railsfrance.org](http://www.railsfrance.org)  
)
