BBpress import issue - LoadError: cannot load such file -- mysql2

I read quite a bit about the mysql2 and problems with installation / update but I am not exactly sure what to do. It is possible i did an install of this under the root user instead of the discourse user which may have caused some permission issues. Any help would be great.

$ bundle exec rake multisite:migrate
rake aborted!
LoadError: cannot load such file – mysql2

It doesn’t look like you’re using our docker setup. You really should! It is so much easier and less error prone.

For example, our application doesn’t use mysql2 unless you are doing an import, so something is messed up here.

actually you are right on point. I am attempting a bbpress import. very difficult by the way with so little accurate information on the import process.

I actually go as far as importing, it loaded all the users, but it errored out on the 2nd post it imported. I think this was related to my discourse admin account having the same name as my wordpress account name.

anyway, I restarted and then ended up with this mysql2 error which is preventing me from importing as well. I cant really figure out where I went wrong to break that. I am about to restore my server from a couple days ago, but would love to just figure this little issue out instead.

I’m not sure why running a rake task would be looking for that mysql gem though. It should only be required when you run the import scripts. Did you edit local files for some reason? If so you might want to revert those changes.

I only edited the import files which 1 file ended up in the config folder and another in the lib/tasks folder. I have not completed the process yet, as I am getting the same error about mysql2 on both the import rake and this upgrade rake.

If i dropped an import file in the config folder inside the docker instance that might require the MySQL2 application, would this be causing the error with upgrading?

Also, anyone have a tip on how to fix this mysql2 issue?

I’m not sure – if it was a ruby file and you put it in a place that is auto loaded, it could be doing it? Might I suggest rebuilding your docker container?

Rebuilding the docker container will reset everything to default in the docker container correct? whats the command for that if you dont mind me asking?

Yes but your database should remain.

./launcher rebuild app

I made some progress again. I hope to finish up tonight with my BBPRESS tonight and I would love to write up a much cleaner how-to import BBPRESS into Discourse for others to use. this has kept my project on hold for about a week now.

1 Like

Did you get anywhere with this? I am having the same issue but for importing a VBulletin forum. Any help would be appreciated.

I noticed you also posted in the mybb topic.

Have you tried using the vBulletin importer?
I think you will have better luck in one of the topics discussing that than you will have in discussions about importers that don’t apply to your need.

I am going to try and work on this a little more this weekend. I am in the middle of writing up my step by step. Taking me a while to put it together and find the time. The Rake file available here to import your bbpress forum does not work without modification.

@Mittineague BasanoviatStephen did you ever figure this thing out? i am having the exact same issue.

Hi Aryeh_Armon, welcome to the forum

I’ve not had the problem as I’ve not needed to do an import.
My reply was more a suggestion to cyborg that he might have better luck resolving a vBulletin import problem in a topic not discussing BBpress import problems as I didn’t know if it was a problem common to both or unique to vBulletin.

This is an old post but I had the same problem. So for future:

you need to import the library via bundler

require 'bundler'
Bundler.require  'mysql2'

source: ruby on rails - require: cannot load such file -- mysql2 - Stack Overflow