Yet Another Xenforo Import Topic

I have followed the following tops to a tee, yet I am stil having issues. I think I am missing something super obvious, so I am hoping a second, of third set of eyes will help.


Running Ubuntu 1804, with a functional base installation of Discourse, and have followed the steps outlined in the thread above. I am so close I can feel it.

When I get to the step that requires me to run

RAILS_ENV=production bundle exec ruby script/import_scripts/xenforo.rb

The following error is returned.

Traceback (most recent call last):

 1: from script/import_scripts/xenforo.rb:3:in `<main>'

script/import_scripts/xenforo.rb:3:in `require’: cannot load such file – mysql2 (LoadError)

If I check the gemfile in the /var/www/discourse directory, I can that mysql2 is loaded

Did you get any errors when you ran the bundle install --no-deployment ?

No errors, just a warning not to run it as root. Here is the output.

root@DearestBare-VM-app:/var/www/discourse# bundle install --no-deployment
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Using rake 13.0.2
Using concurrent-ruby 1.1.7
Using i18n 1.8.5
Using minitest 5.14.2
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using zeitwerk 2.4.2
Using activesupport
Using builder 3.2.4
Using erubi 1.10.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.10
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.8.0
Using rails-html-sanitizer 1.3.0
Using actionview
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack
Using globalid 0.4.2
Using activejob
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailer
Using actionview_precompiler 0.2.3
Using activemodel
Using active_model_serializers 0.8.4
Using activerecord
Using public_suffix 4.0.6
Using addressable 2.7.0
Using aws-eventstream 1.1.0
Using aws-partitions 1.390.0
Using aws-sigv4 1.2.2
Using jmespath 1.4.0
Using aws-sdk-core 3.109.2
Using aws-sdk-kms 1.39.0
Using aws-sdk-s3 1.83.2
Using aws-sdk-sns 1.35.0
Using ember-source 2.18.2
Using execjs 2.7.0
Using barber 0.12.2
Using msgpack 1.3.3
Using bootsnap 1.5.1
Using bundler 2.1.4
Using byebug 11.1.3
Using cbor
Using chunky_png 1.3.15
Using coderay 1.1.3
Using colored2 3.1.2
Using connection_pool 2.2.3
Using openssl-signature_algorithm 1.0.0
Using cose 1.2.0
Using cppjieba_rb 0.3.3
Using css_parser 1.7.1
Using diffy 3.4.0
Using ember-data-source 3.0.2
Using sprockets 3.7.2
Using ember-handlebars-template 0.8.0
Using method_source 1.0.0
Using thor 1.0.1
Using railties
Using jquery-rails 4.4.0
Using discourse-ember-rails 0.18.6
Using discourse-ember-source
Using discourse-fonts 0.0.5
Using exifr 1.3.9
Using fspath 3.1.2
Using image_size 1.5.0
Using in_threads 1.5.4
Using progress 3.5.2
Using discourse_image_optim 0.26.2
Using email_reply_trimmer 0.1.13
Using excon 0.78.1
Using multipart-post 2.1.1
Using ruby2_keywords 0.0.2
Using faraday 1.1.0
Using fast_blank 1.0.0
Using fast_xs 0.8.0
Using fastimage 2.2.0
Using ffi 1.14.1
Using flamegraph 0.9.5
Using gc_tracer 1.5.1
Using guess_html_encoding 0.0.11
Using hashie 4.1.0
Using highline 2.0.3
Using hkdf 0.3.0
Using htmlentities 4.3.4
Using http_accept_language 2.1.1
Using json 2.4.1
Using jwt 2.2.2
Using kgio 2.11.3
Using libv8 (x86_64-linux)
Using request_store 1.5.0
Using lograge 0.11.2
Using logstash-event 1.2.02
Using logstash-logger 0.26.1
Using logster 2.9.4
Using lru_redux 1.1.0
Using lz4-ruby 0.3.3
Using maxminddb 0.1.22
Using memory_profiler 1.0.0
Using message_bus 3.3.4
Using mini_racer 0.3.1
Using redis 4.2.5
Using sidekiq 6.1.2
Using mini_scheduler 0.13.0
Using mini_sql 0.3
Using mini_suffix 0.3.0
Using multi_json 1.15.0
Using multi_xml 0.6.0
Using mustache 1.1.1
Using nio4r 2.5.4
Using nokogumbo 2.0.4
Using oauth 0.5.4
Using oauth2 1.4.4
Using oj 3.10.17
Using omniauth 1.9.1
Using omniauth-oauth2 1.7.0
Using omniauth-facebook 8.0.0
Using omniauth-github 1.4.0
Using omniauth-google-oauth2 0.8.1
Using omniauth-oauth 1.1.0
Using omniauth-twitter 1.4.0
Using sanitize 5.2.1
Using onebox 2.1.9
Using optimist 3.0.1
Using pg 1.2.3
Using pry 0.13.1
Using pry-byebug 3.9.0
Using pry-rails 0.3.9
Using puma 5.1.1
Using r2 0.2.7
Using rack-mini-profiler 2.2.0
Using rack-protection 2.1.0
Using rails_failover 0.6.5
Using rails_multisite 2.5.0
Using raindrops 0.19.1
Using rbtrace 0.4.14
Using rchardet 1.8.0
Using redis-namespace 1.8.0
Using rinku 2.0.6
Using rotp 6.2.0
Using rqrcode_core 0.1.2
Using rqrcode 1.1.2
Using rtlit 0.0.5
Using ruby-readability 0.7.0
Using rubyzip 2.3.0
Using sassc 2.0.1
Using sprockets-rails 3.2.2
Using tilt 2.0.10
Using sassc-rails 2.1.2
Using seed-fu 2.3.9
Using sshkey 2.0.0
Using stackprof 0.2.16
Using uglifier 4.2.0
Using unf_ext
Using unf 0.1.4
Using unicorn 5.7.0
Using webpush 1.1.0
Using xorcist 1.1.2
Bundle complete! 123 Gemfile dependencies, 161 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into `./vendor/bundle`

Hmm. I don’t see mysql in the list there… I think it should be included if I remember correctly from when I’ve done this. You didn’t by chance rebuild the container at some point? That will undo these changes that you make. Double-check your Gemfile to make sure mysql is in there.

You were %100 correct, once I got the mysql gem loaded, the importer took off like a rocket.

I think the original topic is way outdated now, so I think I will write a new one. For example, the command below no longer works.

sudo apt-get install mysql-server mysql-client libmysqlclient-dev

We need to use

sudo apt-get install default-mysql-server default-mysql-client default-libmysqlclient-dev

I appreciate you taking the time to respond and assis here.

We had similar problems during our migration (with mysql2) and found this tutorial helpful, as I recall:

1 Like