strange NoMethodError when trying to work in production mode

my validations are in a file inside lib folder:http://pastie.org/463883

Not so sure what I'm doing wrong, since all of that worked great while in development mode. I'd appreciate any help offered - thanks.

see this blog post I wrote a few months ago:

Fred

Frederick Cheung wrote:

my validations are in a file inside lib folder:http://pastie.org/463883

Not so sure what I'm doing wrong, since all of that worked great while in development mode. I'd appreciate any help offered - thanks.

see this blog post I wrote a few months ago: environment.rb and requiring dependencies - Space Vatican

Fred

I read your post, which made sense. So, I moved all my requires into the initializer in the environment.rb file.

Rails then complained that it couldn't find active record, so I added require 'activerecord', though it didn't seem right (rails should know what that is). It then complained it doesn't know what the downcase method ("Some string".downcase) is, which seems pretty basic.. so I'm not sure what I'm messing up.

# my file:

RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION

require File.join(File.dirname(__FILE__), 'boot')

Rails::Initializer.run do |config|

#.. some default configs, like session, timezone

require 'rubygems' require 'activerecord' require 'lib/custom_validations' require 'will_paginate'

end

I read your post, which made sense. So, I moved all my requires into the initializer in the environment.rb file.

Rails then complained that it couldn't find active record, so I added require 'activerecord', though it didn't seem right (rails should know what that is). It then complained it doesn't know what the downcase method ("Some string".downcase) is, which seems pretty basic.. so I'm not sure what I'm messing up.

My blog post obviously wasn't clear enough - I meant put your require inside an initializer in config/initializers

Fred