# Disqus importer fails - undefined method

**URL:** https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200
**Category:** Bug
**Created:** [12월 1, 2015, 2:54오후 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200 "2015-12-01T14:54:22Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![yyhmsg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yyhmsg/32/115542_2.png) [@yyhmsg](https://meta.discourse.org/u/yyhmsg)
#### Post date: [12월 1, 2015, 2:54오후 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200/1 "2015-12-01T14:54:22Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12월 2, 2015, 3:51오전 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200/2 "2015-12-02T03:51:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [12월 2, 2015, 5:41오후 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200/3 "2015-12-02T17:41:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [12월 7, 2015, 12:36오후 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200/5 "2015-12-07T12:36:32Z")

</div>

This should fix it. 😄

[https://github.com/discourse/discourse/pull/3915#issuecomment-162511924](https://github.com/discourse/discourse/pull/3915#issuecomment-162511924)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [12월 8, 2015, 2:17오후 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200/6 "2015-12-08T14:17:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![yyhmsg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yyhmsg/32/115542_2.png) [@yyhmsg](https://meta.discourse.org/u/yyhmsg)
#### Post date: [12월 13, 2015, 4:17오후 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200/7 "2015-12-13T16:17:08Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [12월 13, 2015, 5:09오후 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200/8 "2015-12-13T17:09:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [12월 13, 2015, 5:09오후 UTC](https://meta.discourse.org/t/disqus-importer-fails-undefined-method/36200/9 "2015-12-13T17:09:30Z")

</div>


