Superclass mismatch for class Tag (TypeError)

I am trying to write a ruby script which includes both the ‘RubyfulSoup’
gem for HTML scouring, and the rails environment so I can access the
database easily. I get the following error when trying to run this
script.

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/helpers/…/…/action_controller/vendor/html-scanner/html/node.rb:276:
superclass mismatch for class Tag (TypeError)
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in require__' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require' from /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/helpers/text_helper.rb:168 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire__’
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in require' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:inrequire’
from
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:202:in
load_helpers' ... 20 levels... from ./../../config/environment.rb:8 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire__’
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require’
from conflict.rb:3

I’ve distilled the offending code down to 3 lines; here are the contents
of my scripts/spider/conflict.rb:

require ‘rubyful_soup’
RAILS_ENV = ‘development’
require File.dirname(FILE) + ‘/…/…/config/environment’

It appears there are two Tag classes. How do I resolve this conflict?

Cheers,
-Jason

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs