0

I have a model called "Comment" in my Rails 3.2 app and it works in my application. However, I made a script, run by rails runner, which inserts data such as comments in my database and I get the following error :

/home/revan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/rexml/comment.rb:23:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)

I found that the problem comes from the Comment defined in REXML which is overshadowing my own Comment model.

I made lots of researches on the Internet but I found no convenient solution. So my question is : How can I avoid the overshadowing of my Comment without changing the name of my model ?

Thank you,

Revan

R3v4n
  • 739
  • 6
  • 11

1 Answers1

0

I had the same issue. In my case it was a gem that included REXML (the gem was provisioning-api). My solution was to specify :require => false on that gem in the Gemfile and require my comment model before requiring the provisioning-api gem.

himynameisjonas
  • 383
  • 4
  • 9