---
title: "mongrel cluster中的敏感字符:Cluster"
author: "helpbs"
date: "2007-12-20T17:19:00Z"
tags: []
slug: "mongrel-cluster-cluster"
draft: false
lastmod: "2012-04-20T18:30:28Z"
id: 1492118
url: "https://helpbs.iteye.com/blog/1492118"
---

开发在webrick上测试rails应用没有任何问题，但一部署在mongrel cluster上就出问题了

总是报

NoMethodError: undefined method \`find’ for Cluster:Module

也就是在执行Cluster.find出的问题

很奇怪的问题，我明明定义一个activerecord class

class Cluster &lt; ActiveRecord::Base

has\_many :servers

has\_many :user\_metas

End

怎么可能不能执行Cluster.find

报错的原因应该是rails把Cluster当成了一个模块而不是一个类，难道有命名冲突

后来才发现确实在ruby的lib里，mongrel cluster确实定一个顶级 Cluster module

该怎么解决，在网上看到这篇 &lt;[http://blog.innerewut.de/tags/mongrel](http://blog.innerewut.de/tags/mongrel)&gt;

和我的问题一样，这位仁兄说：

I already wrote the author about it and hopefully mongrel\_cluster will use a separate namespace in the next release

希望mogrel官方早日解决这个问题，我也不知道该如何能让rails识别我这个class Cluster,我定义了一个模块Space,通过Space::Cluster访问，还是出现同样的错误，于是我采用了最丑陋的做法，我把我的这个类改了名字