# Frustrating "require" problems

**URL:** <https://www.ruby-forum.com/t/frustrating-require-problems/119486>\
**Category:** Rails\
**Created:** [November 7, 2007, 11:11am UTC](https://www.ruby-forum.com/t/frustrating-require-problems/119486 "2007-11-07T11:11:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![creemej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@creemej](https://www.ruby-forum.com/u/creemej)\
**Post date:** [November 7, 2007, 11:11am UTC](https://www.ruby-forum.com/t/frustrating-require-problems/119486/1 "2007-11-07T11:11:35Z")

</div>

Hi,

Recently I got the error with accompaning warning “warning: already  
initialized constant OPTIONS”  
and don’t know how to get rid of it.

For me, it has something to do with dependencies.  
I have looked for similar error-threads but could not find the help  
that I need to resolve it in a good structured way.  
Starting with Rails v.1.2.3 and later Rails v.1.2.5 and now Rails  
2.0\_PR.  
I have tried a lot of things (like rebuilding plugins directory,  
config/environment settings), but I AM NOT AN EXPERT!

I WOULD LIKE TO LEARN MORE, SO THAT I CAN TAKLE THESE BLOCKING  
ERRORS!!!

So, my questions are simple:

1. Where can I find the right information to fully understand what is  
going on, so that I can better test and isolate the problem and maybe  
one day know enough to ask for the correct solution?
2. I have already some good books on Ruby and Ruby on Rails (AWDR,  
Cookbook, RailsRecipes,  
Ruby for Rails), but I do miss some good info on environment/gems/  
plugins/dependencies. Where can I find that?

For immediate help, here is the error message:

6699  
=\> Booting Mongrel (use ‘script/server webrick’ to force WEBrick)  
=\> Rails application starting on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Call with -d to detach  
=\> Ctrl-C to shutdown server  
Exiting  
/Users/creemej/Documents/PROJECTS/SVN/sjamayee/vendor/rails/railties/  
lib/commands/servers/mongrel.rb:16: warning: already initialized  
constant OPTIONS  
/Users/creemej/Documents/PROJECTS/SVN/sjamayee/vendor/rails/railties/  
lib/commands/servers/mongrel.rb:19: undefined method `options' for #<Array:0x24b0404> (NoMethodError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 32:in `gem\_original\_require’  
from /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:  
32:in `require' from /Users/creemej/Documents/PROJECTS/SVN/sjamayee/vendor/rails/ activesupport/lib/active_support/dependencies.rb:496:in `require’  
from /Users/creemej/Documents/PROJECTS/SVN/sjamayee/vendor/rails/  
activesupport/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' from /Users/creemej/Documents/PROJECTS/SVN/sjamayee/vendor/rails/ activesupport/lib/active_support/dependencies.rb:496:in `require’  
from /Users/creemej/Documents/PROJECTS/SVN/sjamayee/vendor/rails/  
railties/lib/commands/server.rb:39  
from ./script/server:3:in `require' from ./script/server:3 from -e:4:in `load’  
from -e:4

---

<div class="post-metadata">

**Author:** ![creemej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@creemej](https://www.ruby-forum.com/u/creemej)\
**Post date:** [November 7, 2007, 11:17am UTC](https://www.ruby-forum.com/t/frustrating-require-problems/119486/2 "2007-11-07T11:17:26Z")

</div>

Hi,

> From my experience, maybe you did not install plugins that has been  
> set on the environment.rb. So, check the environment.rb if you include  
> any plugin like these:  
> require\_gem “acts\_as\_taggable”  
> require ‘rmagick’

Chamnap

---

<div class="post-metadata">

**Author:** ![creemej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@creemej](https://www.ruby-forum.com/u/creemej)\
**Post date:** [November 7, 2007, 3:38pm UTC](https://www.ruby-forum.com/t/frustrating-require-problems/119486/3 "2007-11-07T15:38:06Z")

</div>

Nice try, but my environment.rb is almost empty.

Here it is with a lot of comment-lines stripped out:

# Be sure to restart your web server when you modify this file.

# Specifies gem version of Rails to use when vendor/rails is not

present  
RAILS\_GEM\_VERSION = ‘1.2.5’ unless defined? RAILS\_GEM\_VERSION

# Bootstrap the Rails environment, frameworks, and default

configuration  
require File.join(File.dirname( **FILE** ), ‘boot’)  
Rails::Initializer.run do |config|  
end

# Include your application configuration below

OpenIdAuthentication.store = :file

This is the environment.rb from a standard project, which gives the  
same error when starting the Mongrel-server.  
This simple (initial project) works fine with the Webrick server.

But in other projects produce the same error with both servers  
(mongrel, webrick).

So, the error must be in the rails/ruby/gems environment and freezing  
rails did not help needer.  
I am now using rails\_v\_1.2.5, buth going back to rails\_1.2.3, 1.2.1  
didn’t help.  
I need some deep understanding of environment/gems/dependencies/  
plugins/require and more …

thanks for the help and keep trying.

---

<div class="post-metadata">

**Author:** ![creemej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@creemej](https://www.ruby-forum.com/u/creemej)\
**Post date:** [November 7, 2007, 10:47pm UTC](https://www.ruby-forum.com/t/frustrating-require-problems/119486/4 "2007-11-07T22:47:03Z")

</div>

Hi Bob,

I fully agree with you.  
It must be something in the Ruby environment (gems).  
I have again created a new initial project and it has this error when  
starting Mongrel-server, but not in the Webrick-server.

For me, it must be something with a gem, that is not compatible with  
the Rails v.1.2.5.  
Not specialy linked to mongrel, because in my other projects the error  
is everywhere.

I will try to rebuild the gems directory, peace by peace and test with  
the different projects.  
But I think that there should be an easier way to locate this error.

Hope that this succeeds …

---

<div class="post-metadata">

**Author:** ![creemej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@creemej](https://www.ruby-forum.com/u/creemej)\
**Post date:** [November 7, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/frustrating-require-problems/119486/5 "2007-11-07T16:12:40Z")

</div>

On Nov 7, 2007 5:11 AM, creemej [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> Recently I got the error with accompaning warning “warning: already  
> initialized constant OPTIONS”  
> and don’t know how to get rid of it.  
> …  
> /Users/creemej/Documents/PROJECTS/SVN/sjamayee/vendor/rails/railties/  
> lib/commands/servers/mongrel.rb:19: undefined method `options’ for  
> #Array:0x24b0404 (NoMethodError)

The options method is added to ARGV by optparse.rb (standard ruby).

Does this happen with a plain vanilla rails app, or only with your  
specific app? If it happens to all apps, I think something is hosed  
with your Ruby installation or your Mongrel gems. If it’s happening  
only with one app, something in config/environment.rb is the culprit.  
You need to eliminate items one by one until the problem goes away and  
then focus your efforts there.
