Disqus importer fails - undefined method

import

(Yyhmsg) #1

This may very well be something that I’m doing wrong, but I have a dev setup of discourse on vagrant (that is running fine). I’m now trying to use the disqus.rb import script to bring in my disqus xml comments dump.

Here is what I get:

ruby disqus.rb --file=/vagrant/disqus-forumfixes.xml --post_as=eviltrout --dry_run

disqus.rb:155:in `block in normalize': undefined method `strip!' for nil:NilClass (NoMethodError)
	from disqus.rb:148:in `each'
	from disqus.rb:148:in `normalize'
	from disqus.rb:13:in `initialize'
	from disqus.rb:198:in `new'
	from disqus.rb:198:in `<main>'

Thinking that the error could be sidestepped by adding something for --strip, I tried the following and got:

ruby disqus.rb --file=/vagrant/disqus-forumfixes.xml --post_as=eviltrout --dry_run --strip=‘juxtapose’

disqus.rb:154:in `block in normalize': undefined method `gsub!' for nil:NilClass (NoMethodError)
	from disqus.rb:148:in `each'
	from disqus.rb:148:in `normalize'
	from disqus.rb:13:in `initialize'
	from disqus.rb:198:in `new'
	from disqus.rb:198:in `<main>'

Is there something obvious I’m missing? Any guidance on getting this script to run would be greatly appreciated.


(Jeff Atwood) #2

It is possible this importer is out of date, could you have a quick look sometime this week @eviltrout?


(Robin Ward) #3

The Disqus importer was unfortunately one of the first we did and doesn’t support the better functionality we added later on. I’m not surprised it’s broken. We need an excuse to upgrade it to the new classes and helpers that the other imports use.


(Alan Tan) #5

This should fix it. :smile:


(Alan Tan) #6

@yyhmsg Let me know if the importer is working for you :smile:


(Yyhmsg) #7

@tgxworld - thanks for the fix, yes it appears to work in as far as I’ve had time to test it. At least I get through the dry_run just fine with no errors. I haven’t actually had a chance to do it with production data yet to be sure. I’ll write in if there are any issues.


(Alan Tan) #8

Ok I’ll close this first. Feel free to flag if you run into any more issues.


(Alan Tan) #9