I am using Ruby 3.0.4 with Rails 7.0.4 with rvm. I have a Rails project, but when I try to do anything with the mysql database (create or setup), it throws a segmentation fault.
I am on Ubuntu Ubuntu 22.04.1 LTS. The mysql version is Ver 8.0.31-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu)).
Here is some of the error:
```
Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
W, [2023-01-12T12:59:10.830314 #125121] WARN -- Skylight: [SKYLIGHT] [5.3.4] Running Skylight in development mode. No data will be reported until you deploy your app.
(To disable this message for all local apps, run `skylight disable_dev_warning`.)
/External-drive/Personal/Projects/breakabletoy/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.4/lib/mysql2/client.rb:95: [BUG] Segmentation fault at 0x0000000000000000
ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0049 p:---- s:0274 e:000273 CFUNC :connect
c:0048 p:0623 s:0262 e:000261 METHOD /External-drive/Personal/Projects/breakabletoy/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.4/lib/mysql2/client.rb:95 [FINISH]
```
...and, at the end...
```
7f91e72b2000-7f91e72dc000 r-xp 00002000 103:02 31066233 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f91e72dc000-7f91e72e7000 r--p 0002c000 103:02 31066233 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f91e72e7000-7f91e72e8000 r-xp 00000000 00:00 0
7f91e72e8000-7f91e72ea000 r--p 00037000 103:02 31066233 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f91e72ea000-7f91e72ec000 rw-p 00039000 103:02 31066233 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7ffedcfb9000-7ffedd7b8000 rw-p 00000000 00:00 0 [stack]
7ffedd7bc000-7ffedd7c0000 r--p 00000000 00:00 0 [vvar]
7ffedd7c0000-7ffedd7c2000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
```
The fix at mysql2 Segmentation fault at 0x0000000000000000 doesn't work, given that sudo apt install libmariadbclient-dev
isn't found.
I've also installed the dependencies required in the github of the page https://github.com/brianmario/mysql2. I've also uninstalled and reinstalled my rvm, but nothing works. Any help would be greatly appreciated.