Thanks so much for helping out. I was close to pulling my hair.
Funny thing is, I get this error even without providing the file path. i.e.
root@ss-app:/var/www/discourse# pwd
/var/www/discourse
root@ss-app:/var/www/discourse# RAILS_ENV=production ruby script/import_scripts/disqus.rb
…..
…..
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:37: warning: already initialized constant Nokogiri::XML::ParseOptions::DTDATTR
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:37: warning: previous definition of DTDATTR was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:39: warning: already initialized constant Nokogiri::XML::ParseOptions::DTDVALID
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:39: warning: previous definition of DTDVALID was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:41: warning: already initialized constant Nokogiri::XML::ParseOptions::NOERROR
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:41: warning: previous definition of NOERROR was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:43: warning: already initialized constant Nokogiri::XML::ParseOptions::NOWARNING
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:43: warning: previous definition of NOWARNING was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:45: warning: already initialized constant Nokogiri::XML::ParseOptions::PEDANTIC
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:45: warning: previous definition of PEDANTIC was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:47: warning: already initialized constant Nokogiri::XML::ParseOptions::NOBLANKS
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:47: warning: previous definition of NOBLANKS was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:49: warning: already initialized constant Nokogiri::XML::ParseOptions::SAX1
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:49: warning: previous definition of SAX1 was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:51: warning: already initialized constant Nokogiri::XML::ParseOptions::XINCLUDE
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:51: warning: previous definition of XINCLUDE was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:53: warning: already initialized constant Nokogiri::XML::ParseOptions::NONET
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:53: warning: previous definition of NONET was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:55: warning: already initialized constant Nokogiri::XML::ParseOptions::NODICT
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:55: warning: previous definition of NODICT was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:57: warning: already initialized constant Nokogiri::XML::ParseOptions::NSCLEAN
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:57: warning: previous definition of NSCLEAN was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:59: warning: already initialized constant Nokogiri::XML::ParseOptions::NOCDATA
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:59: warning: previous definition of NOCDATA was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:61: warning: already initialized constant Nokogiri::XML::ParseOptions::NOXINCNODE
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:61: warning: previous definition of NOXINCNODE was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:63: warning: already initialized constant Nokogiri::XML::ParseOptions::COMPACT
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:63: warning: previous definition of COMPACT was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:65: warning: already initialized constant Nokogiri::XML::ParseOptions::OLD10
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:65: warning: previous definition of OLD10 was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:67: warning: already initialized constant Nokogiri::XML::ParseOptions::NOBASEFIX
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:67: warning: previous definition of NOBASEFIX was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:69: warning: already initialized constant Nokogiri::XML::ParseOptions::HUGE
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:69: warning: previous definition of HUGE was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:72: warning: already initialized constant Nokogiri::XML::ParseOptions::DEFAULT_XML
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:72: warning: previous definition of DEFAULT_XML was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:74: warning: already initialized constant Nokogiri::XML::ParseOptions::DEFAULT_HTML
/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/parse_options.rb:74: warning: previous definition of DEFAULT_HTML was here
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/sax/parser.rb:33:in `<class:Parser>': superclass mismatch for class Attribute (TypeError)
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/sax/parser.rb:32:in `<module:SAX>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/sax/parser.rb:3:in `<module:XML>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/sax/parser.rb:2:in `<module:Nokogiri>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/sax/parser.rb:1:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/sax.rb:3:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/sax.rb:3:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml.rb:3:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri/xml.rb:3:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:36:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:36:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/loofah-2.1.1/lib/loofah.rb:3:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/loofah-2.1.1/lib/loofah.rb:3:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/sanitize_helper.rb:2:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/sanitize_helper.rb:2:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/text_helper.rb:32:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/text_helper.rb:32:in `<module:TextHelper>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/text_helper.rb:29:in `<module:Helpers>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/text_helper.rb:6:in `<module:ActionView>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/text_helper.rb:4:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/form_tag_helper.rb:18:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/form_tag_helper.rb:6:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/form_helper.rb:4:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers/form_helper.rb:4:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers.rb:50:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers.rb:50:in `<module:Helpers>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers.rb:4:in `<module:ActionView>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/helpers.rb:3:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:7:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:7:in `<module:Context>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:6:in `<module:Rails>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:5:in `<module:Sprockets>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:4:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:7:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:7:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/all.rb:14:in `require'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/all.rb:14:in `block in <top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/all.rb:12:in `each'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/all.rb:12:in `<top (required)>'
from /var/www/discourse/config/application.rb:2:in `require'
from /var/www/discourse/config/application.rb:2:in `<top (required)>'
from /usr/local/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /var/www/discourse/config/environment.rb:2:in `<top (required)>'
from /var/www/discourse/script/import_scripts/base.rb:14:in `require_relative'
from /var/www/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
from /usr/local/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from script/import_scripts/disqus.rb:3:in `<main>'