`
xitong
  • 浏览: 6232028 次
文章分类
社区版块
存档分类
最新评论

mongrel cluster中的敏感字符:Cluster

 
阅读更多
开发在webrick上测试rails应用没有任何问题,但一部署在mongrel cluster上就出问题了
总是报
NoMethodError: undefined method `find’ for Cluster:Module
也就是在执行Cluster.find出的问题
很奇怪的问题,我明明定义一个activerecord class
class Cluster < ActiveRecord::Base
has_many :servers
has_many :user_metas
End
怎么可能不能执行Cluster.find
报错的原因应该是rails把Cluster当成了一个模块而不是一个类,难道有命名冲突
后来才发现确实在ruby的lib里,mongrel cluster确实定一个顶级 Cluster module
该怎么解决,在网上看到这篇 <http://blog.innerewut.de/tags/mongrel>
和我的问题一样,这位仁兄说:
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访问,还是出现同样的错误,于是我采用了最丑陋的做法,我把我的这个类改了名字
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics