さらに別のXenForoインポートトピック

以下の手順を完璧に追って実施しましたが、まだ問題が発生しています。超基本的な何かを見落としているのだと思いますので、第三者、あるいは第四者の目を通してもらうことで解決できることを願っています。

Import

Ubuntu 1804 を使用しており、Discourse の機能する基本インストールが完了している状態で、上記のスレッドに記載された手順に従いました。もうすぐ解決できそうな気がします。

次のステップで以下のコマンドを実行する必要があります。

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

すると、以下のエラーが返されます。

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)

/var/www/discourse ディレクトリ内の Gemfile を確認すると、mysql2 が読み込まれていることが確認できます。

bundle install --no-deploymentを実行した際にエラーは発生しましたか?

エラーはありませんが、root として実行しないようにという警告が出ました。出力は以下の通りです。

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 6.0.3.3
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 6.0.3.3
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.0.3.3
Using globalid 0.4.2
Using activejob 6.0.3.3
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailer 6.0.3.3
Using actionview_precompiler 0.2.3
Using activemodel 6.0.3.3
Using active_model_serializers 0.8.4
Using activerecord 6.0.3.3
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 0.5.9.6
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 6.0.3.3
Using jquery-rails 4.4.0
Using discourse-ember-rails 0.18.6
Using discourse-ember-source 3.12.2.2
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 8.4.255.0 (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 0.0.7.7
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`

うーん、リストに mysql が表示されていないようですね…私の記憶が正しければ、以前同様の作業をした際には含まれていたはずです。もしかして、コンテナを再構築したことはありませんか?それだと、あなたが行った変更が元に戻ってしまいます。Gemfile をもう一度確認して、mysql が含まれているか確認してください。

100%おっしゃる通りです。mysql gemをロードしたら、インポーターはロケットのように動き出しました。

元のトピックはすでに時代遅れになっていると思うので、新しいトピックを作成しようと思います。例えば、以下のコマンドはもはや機能しません。

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

代わりに以下のコマンドを使用する必要があります。

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

お時間を使って回答とサポートをいただき、ありがとうございます。

私たちは移行中(mysql2 を使用)に同様の問題に直面し、このチュートリアルが役立ったと記憶しています:

https://mpolinowski.github.io/migrating-from-v-bulletin-5-to-discourse-on-cent-os-8

「いいね!」 1