---
title: "undefined method ... for REXML::Class"
author: "muyu"
date: "2008-11-01T10:22:14Z"
tags: []
slug: "undefined-method-for-rexml-class"
draft: false
lastmod: "2008-11-01T10:22:14Z"
id: 260760
url: "https://muyu.iteye.com/blog/260760"
---

undefined method \`get\_list\_by\_object' for REXML::Comment:Class

 

程序突然冒充个这个错误，前段时间还好好的！

 

查了查资料，发现是由于我定义的Comment类和REXML中的Comment冲突了。在我还没有引用REXML之前，程序运转良好。后来，项目中加入了解析XML功能，我就引用了REXML，这时候问题出现了。

 

**解决方法**

 

除了重新换个名称，我还想不到更好的办法。