mysql2 icon indicating copy to clipboard operation
mysql2 copied to clipboard

bundle install fails with Gem::Ext::BuildError

Open TakahashiKazuaki opened this issue 3 years ago • 34 comments

I'm using mysql2 gem with the Gemfile definition as

platforms :ruby do
  gem 'mysql2'
  gem 'pg', '~> 1.1'
end

But what happens is bundle install is interrupted by Gem::Ext::BuildError. All logs are as follows.

Installing mysql2 0.5.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/myname/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/ext/mysql2
/Users/myname/.rbenv/versions/3.0.0/bin/ruby -I /Users/myname/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r
./siteconf20210305-36402-x7wk07.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes
-----
Using mysql_config at /usr/local/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking for SSL_MODE_PREFERRED in mysql.h... yes
checking for SSL_MODE_REQUIRED in mysql.h... yes
checking for SSL_MODE_VERIFY_CA in mysql.h... yes
checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes
checking for MYSQL.net.vio in mysql.h... yes
checking for MYSQL.net.pvio in mysql.h... no
checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes
checking for my_bool in mysql.h... no
-----
Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
-----
-----
Setting libpath to /usr/local/Cellar/mysql/8.0.23_1/lib
-----
creating Makefile

current directory: /Users/myname/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/ext/mysql2
make "DESTDIR=" clean

current directory: /Users/myname/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/ext/mysql2
make "DESTDIR="
compiling client.c
client.c:787:14: warning: incompatible pointer types passing 'VALUE (void *)' (aka 'unsigned long (void *)') to parameter of type 'VALUE
(*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-pointer-types]
  rb_rescue2(do_send_query, (VALUE)&args, disconnect_and_raise, self, rb_eException, (VALUE)0);
             ^~~~~~~~~~~~~
/Users/myname/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/internal/iterator.h:51:25: note: passing argument to parameter here
VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
                        ^
client.c:795:16: warning: incompatible pointer types passing 'VALUE (void *)' (aka 'unsigned long (void *)') to parameter of type 'VALUE
(*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-pointer-types]
    rb_rescue2(do_query, (VALUE)&async_args, disconnect_and_raise, self, rb_eException, (VALUE)0);
               ^~~~~~~~
/Users/myname/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/internal/iterator.h:51:25: note: passing argument to parameter here
VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
                        ^
2 warnings generated.
compiling infile.c
compiling mysql2_ext.c
compiling result.c
compiling statement.c
linking shared-object mysql2/mysql2.bundle
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/myname/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3 for inspection.
Results logged to /Users/myname/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mysql2-0.5.3/gem_make.out

An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  mysql2

Environment

  • Bundler version 2.2.3
  • ruby 3.0.0p0

TakahashiKazuaki avatar Mar 05 '21 10:03 TakahashiKazuaki

checking for my_bool in mysql.h... no

I think you need to install MySQL or MariaDB development header package on your environment. Which OS are you using? Which DB (MySQL or MariaDB) are you using?

junaruga avatar Mar 05 '21 10:03 junaruga

@junaruga Thank you for reply.

I am using

  • Mac OS X(10.15.7)
  • mysql(stable 8.0.23)(installed using homebrew)

TakahashiKazuaki avatar Mar 05 '21 12:03 TakahashiKazuaki

OK, considering you installing mysql brew package, maybe you can try to run the following commands on your terminal before running bundle install. It's for the compiler in the process of installing mysql gem to load the files.

DB_PREFIX="$(brew --prefix "mysql")"
export PATH="${DB_PREFIX}/bin:${PATH}"
export LDFLAGS="-L${DB_PREFIX}/lib"
export CPPFLAGS="-I${DB_PREFIX}/include"

The commands come from the following shell script file, as this repository has the macOS mysql case on GitHub Actions CI. https://github.com/brianmario/mysql2/blob/cab1d34aabd7515053429203e7397cdd1f2ac234/ci/setup.sh#L90-L93

junaruga avatar Mar 05 '21 12:03 junaruga

Thank you for valuable suggestion. As you instructed, I've tried the commands before running bundle install.

But it resulted in the same false, outputting the checking status of checking for my_bool in mysql.h... no. I also experimented other patterns such as

export DB_PREFIX="$(brew --prefix "${DB}")" 

or

export PATH="$(brew --prefix "${DB}")/bin:${PATH}" 

which continues to output the same result.

TakahashiKazuaki avatar Mar 06 '21 01:03 TakahashiKazuaki

What's the result after running commands? Could you make sure the mysql.h really exists on the path? Could you share the result of the following command?

echo $LDFLAGS
echo $CPPFLAGS
ls "$(brew --prefix "mysql")/include"

If you running the command including ${DB} on your environment, that's wrong. Because possibly the variable${DB} is not defined there.

I just found an example by searching website. Could you try if it is needed? https://gist.github.com/fernandoaleman/12698634824f5d5c00ab57b72ee2ad52

ls /usr/local/Cellar/mysql/X.Y.Z/bin/mysql_config # Makesure the mysql_config exists.
gem install mysql2 -v '0.5.3' -- --with-mysql-config=/usr/local/Cellar/mysql/X.Y.Z/bin/mysql_config

junaruga avatar Mar 06 '21 09:03 junaruga

Here is other documents that might be helpful for you. https://github.com/brianmario/mysql2#configuration-options https://coderwall.com/p/iy8wkw/install-mysql2-gem-with-mysql-installed-with-homebrew

junaruga avatar Mar 06 '21 09:03 junaruga

Could you share the result of the following command?

The results are as follows. Actually, I have no idea what those results mean...

% echo $LDFLAGS
-L/usr/local/opt/mysql/lib

% echo $CPPFLAGS
-I/usr/local/opt/mysql/include

% ls "$(brew --prefix "mysql")/include"
mysql

And I tried the command searched by you, the result is

% ls /usr/local/Cellar/mysql/X.Y.Z/bin/mysql_config

ls: /usr/local/Cellar/mysql/X.Y.Z/bin/mysql_config: No such file or directory

TakahashiKazuaki avatar Mar 08 '21 01:03 TakahashiKazuaki

Okay. The X.Y.Z was just example to show the mysql version directory. It does not mean the actual directory.

I think the steps to fix your issue could be

  1. Find mysql.h and mysql_config under your installed mysql directory.
  2. Then try to install gem install mysql2 possibly with some arguments or environment variables at first before using Bundler.

However as I do not install mysql on my Mac, maybe it's better for other people to help you.

junaruga avatar Mar 08 '21 10:03 junaruga

This works for me for homebrew, inspired by @junaruga's link. Adjust version as needed:

 rbenv exec gem install mysql2 -- \
 --with-mysql-lib=/opt/homebrew/Cellar/mysql/8.0.25_1/lib \
 --with-mysql-dir=/opt/homebrew/Cellar/mysql/8.0.25_1 \
 --with-mysql-config=/opt/homebrew/Cellar/mysql/8.0.25_1/bin/mysql_config \
 --with-mysql-include=/opt/homebrew/Cellar/mysql/8.0.25_1/include 

MatthiasWinkelmann avatar May 23 '21 03:05 MatthiasWinkelmann

This also worked for me: export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ and then try to install the gem again.

franzejr avatar Jun 13 '21 19:06 franzejr

I can also confirm that the below solution worked for me:

This also worked for me: export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ and then try to install the gem again.

vcc-LG avatar Jun 15 '21 12:06 vcc-LG

I've successfully installed a mysql gem with changed paths

gem install mysql2 -- \
 --with-mysql-lib=/usr/local/Cellar/mysql/8.0.23/lib \
 --with-mysql-dir=/usr/local/Cellar/mysql/8.0.23 \
 --with-mysql-config=/usr/local/Cellar/mysql/8.0.23/bin/mysql_config \
 --with-mysql-include=/usr/local/Cellar/mysql/8.0.23/include 

Neodelf avatar Jun 19 '21 20:06 Neodelf

I have been struggling with this. I have the same issue here when using homebrew. I did successfully install mysql2 locally but when I bundle install I get the same error again: ld: library not found for -lssl

This is probably due to libraries paths not being set properly. Any help is welcome

Henrik41 avatar Jun 20 '21 11:06 Henrik41

I ran into this on a new mac m1. Fresh install of homebrew, rbenv, ruby 2.5.1

Setting LIBRARY_PATH did not work for me, however, passing the MySQL directories as specified by @MatthiasWinkelmann did work.

web-connect avatar Jun 24 '21 23:06 web-connect

Same as @web-connect but with ruby 3.0.1

Nothing was working for me, but passing the specific locations of the directories while installing the gem worked fine. Danke @MatthiasWinkelmann

NOTE: in my case had to add sudo to the start of it

wmanica avatar Jul 04 '21 09:07 wmanica

I tried several ways and was able to solve the problem 🎉

Here are what I did.

  1. I executed brew update.

  2. I increased the version of ruby.

% rbenv global 3.0.2
% rbenv version
3.0.2 (set by /Users/myusername/.rbenv/version)
  1. I executed gem install mysql2 the way shared by @junaruga and tried by @MatthiasWinkelmann and @Neodelf .

NOTE: paths are changed

% gem install mysql2 -- \
>  --with-mysql-lib=/usr/local/Cellar/mysql/8.0.25_1/lib \
>  --with-mysql-dir=/usr/local/Cellar/mysql/8.0.25_1 \
>  --with-mysql-config=/usr/local/Cellar/mysql/8.0.25_1/bin/mysql_config \
>  --with-mysql-include=/usr/local/Cellar/mysql/8.0.25_1/include

Building native extensions with: '--with-mysql-lib=/usr/local/Cellar/mysql/8.0.25_1/lib --with-mysql-dir=/usr/local/Cellar/mysql/8.0.25_1 --with-mysql-config=/usr/local/Cellar/mysql/8.0.25_1/bin/mysql_config --with-mysql-include=/usr/local/Cellar/mysql/8.0.25_1/include'
This could take a while...
Successfully installed mysql2-0.5.3
Parsing documentation for mysql2-0.5.3
Installing ri documentation for mysql2-0.5.3
Done installing documentation for mysql2 after 0 seconds
1 gem installed

At this point, I don't know which the direct solution is. This is just a quick note. 🙏🏻

TakahashiKazuaki avatar Jul 17 '21 08:07 TakahashiKazuaki

Folks seem to be mixing instructions for x86 (/usr/local/Cellar) and arm64 (for the new M1 macs) (/opt/homebrew/Cellar) brew installations, as well as different mysql versions.

Here's a one-shot that should work for whichever approach you've gone (assuming a single version of mysql installed with brew):

mysql_version=$(brew list --versions mysql | tr ' ' '\n' | tail -1)
mysql_path=$(brew --cellar mysql)/$mysql_version

gem install mysql2 -- \
--with-mysql-lib=$mysql_path/lib \
--with-mysql-dir=$mysql_path \
--with-mysql-config=$mysql_path/bin/mysql_config \
--with-mysql-include=$mysql_path/include 

Though if you are having issues, understanding whether you're installing M1 native or using the Intel x86 (emulation on new M1 chips, or native on other mac machines) is pretty important, because mixing and matching deps in different architectures won't work!

supermario avatar Aug 02 '21 21:08 supermario

Folks seem to be mixing instructions for x86 (/usr/local/Cellar) and arm64 (for the new M1 macs) (/opt/homebrew/Cellar) brew installations, as well as different mysql versions.

Here's a one-shot that should work for whichever approach you've gone (assuming a single version of mysql installed with brew):

mysql_version=$(brew list --versions mysql | tr ' ' '\n' | tail -1)
mysql_path=$(brew --cellar mysql)/$mysql_version

gem install mysql2 -- \
--with-mysql-lib=$mysql_path/lib \
--with-mysql-dir=$mysql_path \
--with-mysql-config=$mysql_path/bin/mysql_config \
--with-mysql-include=$mysql_path/include 

Though if you are having issues, understanding whether you're installing M1 native or using the Intel x86 (emulation on new M1 chips, or native on other mac machines) is pretty important, because mixing and matching deps in different architectures won't work!

Thank you, this is very helpful!

letired avatar Aug 04 '21 15:08 letired

This also worked for me: export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ and then try to install the gem again.

The above Setting LIBRARY_PATH didn't work, but the following settings worked.

export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/:$(brew --prefix openssl)/lib

This issue helped me. thank you everyone!!

fujisawaryohei avatar Sep 01 '21 12:09 fujisawaryohei

Folks seem to be mixing instructions for x86 (/usr/local/Cellar) and arm64 (for the new M1 macs) (/opt/homebrew/Cellar) brew installations, as well as different mysql versions.

Here's a one-shot that should work for whichever approach you've gone (assuming a single version of mysql installed with brew):

mysql_version=$(brew list --versions mysql | tr ' ' '\n' | tail -1)
mysql_path=$(brew --cellar mysql)/$mysql_version

gem install mysql2 -- \
--with-mysql-lib=$mysql_path/lib \
--with-mysql-dir=$mysql_path \
--with-mysql-config=$mysql_path/bin/mysql_config \
--with-mysql-include=$mysql_path/include 

Though if you are having issues, understanding whether you're installing M1 native or using the Intel x86 (emulation on new M1 chips, or native on other mac machines) is pretty important, because mixing and matching deps in different architectures won't work!

Thank you, worked great. Is possible to modify the gem so future users won't run into this issue when installing the mysql2 gem?

johnpitchko avatar Oct 08 '21 15:10 johnpitchko

Thanks @MatthiasWinkelmann

gem install mysql2 -- \
 --with-mysql-lib=/usr/local/Cellar/mysql/8.0.26/lib \
 --with-mysql-dir=/usr/local/Cellar/mysql/8.0.26 \
 --with-mysql-config=/usr/local/Cellar/mysql/8.0.26/bin/mysql_config \
 --with-mysql-include=/usr/local/Cellar/mysql/8.0.26/include

works for me.

gazeldx avatar Nov 16 '21 07:11 gazeldx

export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/:$(brew --prefix openssl)/lib

This was partly the solution for me. But as @letired mentioned above

brew --prefix zstd

returns

/usr/local/opt/zstd

which is not valid location where openssl is installed. Instead, I have to user this

export LIBRARY_PATH=/usr/local/Cellar/[email protected]/1.1.1l_1/lib

After exporting LIBRARY_PATH, bundle install works as a charm. The solution with specifying options to gem install mysql2 also works, but that does not solve the issue in the right way.

Thanks everyone!

amerpersonal avatar Dec 09 '21 13:12 amerpersonal

Adapting the suggestions above, this fixed my ability to install mysql2 with Bundler:

bundle config --global build.mysql2 "--with-cppflags=-I$(brew --prefix openssl)/include --with-ldflags=-L$(brew --prefix openssl)/lib --with-mysql-lib-$(brew --prefix mysql)/lib --with-mysql-dir=$(brew --prefix mysql) --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config --with-mysql-include=$(brew --prefix mysql)/include"

brandt avatar Jan 20 '22 21:01 brandt

Adapting the suggestions above, this fixed my ability to install mysql2 with Bundler:

bundle config --global build.mysql2 "--with-cppflags=-I$(brew --prefix openssl)/include --with-ldflags=-L$(brew --prefix openssl)/lib --with-mysql-lib-$(brew --prefix mysql)/lib --with-mysql-dir=$(brew --prefix mysql) --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config --with-mysql-include=$(brew --prefix mysql)/include"

This worked, thanks.

Klekum avatar Jan 21 '22 10:01 Klekum

```shell
bundle config --global build.mysql2 "--with-cppflags=-I$(brew --prefix openssl)/include --with-ldflags=-L$(brew --prefix openssl)/lib --with-mysql-lib-$(brew --prefix mysql)/lib --with-mysql-dir=$(brew --prefix mysql) --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config --with-mysql-include=$(brew --prefix mysql)/include"

I did that exact command and I am still getting

linking shared-object mysql2/mysql2.bundle
ld: library not found for -lzstd

On Mac OS 12.1

bobber205 avatar Feb 01 '22 22:02 bobber205

export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/

I tried literally 10+ things and this is the only thing that did it for me!

bobber205 avatar Feb 01 '22 22:02 bobber205

Perhaps this would work then:

Gem

gem install mysql2 -- \
  --with-cppflags="-I$(brew --prefix openssl)/include -I$(brew --prefix zstd)/include" \
  --with-ldflags="-L$(brew --prefix openssl)/lib -L$(brew --prefix zstd)/lib" \
  --with-mysql-lib-$(brew --prefix mysql)/lib \
  --with-mysql-dir=$(brew --prefix mysql) \
  --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config \
  --with-mysql-include=$(brew --prefix mysql)/include

Bundler

bundle config --global build.mysql2 "--with-cppflags='-I$(brew --prefix openssl)/include -I$(brew --prefix zstd)/include' --with-ldflags='-L$(brew --prefix openssl)/lib -L$(brew --prefix zstd)/lib' --with-mysql-lib-$(brew --prefix mysql)/lib --with-mysql-dir=$(brew --prefix mysql) --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config --with-mysql-include=$(brew --prefix mysql)/include"

brandt avatar Feb 01 '22 23:02 brandt

This also worked for me: export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ and then try to install the gem again.

On Monteray (12.1 M1 Max chip) I also had to add openssl to my library path:

LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/:$(brew --prefix openssl)/lib/ \
bundle # or gem install mysql2

BuonOmo avatar Feb 11 '22 08:02 BuonOmo

On Monterey(intel) this worked for me:

brew install mysql openssl
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
gem install mysql2 -v '0.5.3' \
  --source 'https://rubygems.org/' -- \
  --with-cppflags=-I/usr/local/opt/openssl/include \
  --with-ldflags=-L/usr/local/opt/openssl/lib

bundle install

ecdemis123 avatar Mar 16 '22 22:03 ecdemis123

This also worked for me: export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ and then try to install the gem again.

Thanks, this worked for me.

Marvelxy avatar Mar 26 '22 09:03 Marvelxy

I hate to queue up here - but regrettably, I find myself utterly not qualified to resolve this issue 😢

Installing mysql2 0.5.3 with native extensions
Bundle complete! 28 Gemfile dependencies, 92 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
√ src % rails c
dyld: lazy symbol binding failed: Symbol not found: _mysql_server_init
  Referenced from: /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

dyld: Symbol not found: _mysql_server_init
  Referenced from: /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

zsh: abort      rails c
?134 src % 

On my Apple MBAir M1 with Big Sur 11.6.5 I've been happy running my Rails projects in containers whilst procrastinating with regards to testing - now that this had to stop, and I started rails test-ing I started seeing a lot of MySQL errors totally randomly. Tests would light up all green on one seed and on the next some or all would fail 🤯

So, I set out to do what I had not been able to 9-10 months ago - and sadly I can, so far, conclude that things have not improved beyond MySQL running "natively" as an ARM64 app.

Anyone managed to brew install mysql (I did) and then subsequently bundle install in a Ruby 3.0.1 project (I didn't) ?

But then again - I've tried with just about every single piece of advise I've been able to scoop up 'out there' - with this being my latest/best bet only to fail miserably

gem install mysql2 -v '0.5.3' -- \
    --with-mysql-config=$(brew --prefix "mysql")/bin/mysql_config \
    --with-ldflags=-L$(brew --prefix "openssl")/lib \
    --with-cppflags=-I$(brew --prefix "openssl")/include \
    --with-mysql-lib=$(brew --prefix "mysql")/lib \
    --with-mysql-dir=$(brew --prefix "mysql") \
    --with-mysql-include=$(brew --prefix "mysql")/include

wdiechmann avatar Apr 27 '22 17:04 wdiechmann

From the depths of peril I'm battling the dragons of silicon cores and whilst betting on ARM64 I must confess that my resolve is wearing thin fast 😢

Updated my macOS to the latest shining thing from the buena vista in Monterey and followed it with a fresh dressing on the brew wound before I charged forward with a reinstall of mysql. All was good and I tried the above install of the mysql2 gem - and even offered a arch -arm64 gem install... sadly, to no avail as my latest CLI informs:

Bundle complete! 28 Gemfile dependencies, 92 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
√ src % rails c
/Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require': dlopen(/Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.bundle, 0x0009): symbol not found in flat namespace '_mysql_affected_rows' - /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.bundle (LoadError)
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/lib/mysql2.rb:36:in `<main>'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:66:in `block (2 levels) in require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:61:in `each'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:61:in `block in require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:50:in `each'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:50:in `require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/3.0.0/bundler.rb:173:in `require'
        from /Users/walther/Deling/Walther/src/speicher/hours/src/config/application.rb:7:in `<main>'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.2.4/lib/rails/command/actions.rb:22:in `require_application!'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.2.4/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.2.4/lib/rails/commands/console/console_command.rb:101:in `perform'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.2.4/lib/rails/command/base.rb:87:in `perform'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.2.4/lib/rails/command.rb:48:in `invoke'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.2.4/lib/rails/commands.rb:18:in `<main>'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/walther/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from bin/rails:4:in `<main>'

wdiechmann avatar Apr 29 '22 22:04 wdiechmann

RUN apk --no-cache add mariadb-dev for alpine docker containers install mariadb headers

noraj avatar Jul 22 '22 16:07 noraj