Topic: memcached with phusion not initializing

hi.. i followed the above instructions and got it to work on a windows machine where im running a single mongrel instance (very basic setup). i have a staging setup that is running linux (fedora) with apache and phusion passenger.. the moment i send a request, it gives an error saying - "uninitialized constant ActionController" in environment.rb. here is what i have in there -

require 'memcache'
Rails::Initializer.run do |config|
....
memcache_options = {
:compression => false,
:debug => false,
:namespace => "mem-#{RAILS_ENV}",
:readonly => false,
:urlencode => false
}

memcache_servers = [ '127.0.0.1:11211' ]

CACHE = MemCache.new(memcache_options)
CACHE.servers = memcache_servers
ActionController::Base.session_options[:cache] = CACHE

config.action_controller.session_store = :mem_cache_store
...

what could be the problem here? any ideas?

thanks

Re: memcached with phusion not initializing

I was able to solve and unblock myself by doing the following -

require 'memcache'

Rails::Initializer.run do |config|
...
  config.action_controller.session_store = :mem_cache_store

  memcache_options = {
    :compression => false,
    :debug => false,
    :namespace => "mem-#{RAILS_ENV}",
    :readonly => false,
    :urlencode => false
  }

  memcache_servers = [ '127.0.0.1:11211' ]

  CACHE = MemCache.new(memcache_options)
  CACHE.servers = memcache_servers

  begin
    PhusionPassenger.on_event(:starting_worker_process) do |forked|
      if forked
        CACHE.reset
      end
    end
  rescue NameError => error
  end
...
end

hope that helps...

thanks