Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with gem installing #1350

Open
mkrsvsky opened this issue Feb 1, 2024 · 4 comments
Open

Problem with gem installing #1350

mkrsvsky opened this issue Feb 1, 2024 · 4 comments

Comments

@mkrsvsky
Copy link

mkrsvsky commented Feb 1, 2024


Fetching gem metadata from https://rubygems.org/.......
Installing mysql2 0.5.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/mysql2-0.5.5/ext/mysql2
/Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/bin/ruby extconf.rb --with-ldflags\=-L/opt/homebrew/opt/[email protected]/lib
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_gc_mark_movable()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enc_interned_str() in ruby.h... yes
/opt/homebrew/bin/brew
-----
Using mysql_config at /opt/homebrew/opt/mysql-client/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_DEFAULT_AUTH in mysql.h... yes
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 /opt/homebrew/opt/mysql-client/lib
-----
creating Makefile

current directory: /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/mysql2-0.5.5/ext/mysql2
make DESTDIR\= sitearchdir\=./.gem.20240201-74689-6gvx2h sitelibdir\=./.gem.20240201-74689-6gvx2h clean

current directory: /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/mysql2-0.5.5/ext/mysql2
make DESTDIR\= sitearchdir\=./.gem.20240201-74689-6gvx2h sitelibdir\=./.gem.20240201-74689-6gvx2h
compiling client.c
In file included from client.c:15:
./mysql_enc_name_to_ruby.h:43:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x
[-Wdeprecated-non-prototype]
mysql2_mysql_enc_name_to_rb_hash (str, len)
^
./mysql_enc_name_to_ruby.h:86:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x
[-Wdeprecated-non-prototype]
mysql2_mysql_enc_name_to_rb (str, len)
^
client.c:1438:3: error: call to undeclared function 'mysql_ssl_set'; ISO C99 and later do not support implicit function declarations
[-Wimplicit-function-declaration]
  mysql_ssl_set(wrapper->client,
  ^
client.c:1438:3: note: did you mean 'mysql_close'?
/opt/homebrew/opt/mysql-client/include/mysql/mysql.h:797:14: note: 'mysql_close' declared here
void STDCALL mysql_close(MYSQL *sock);
             ^
2 warnings and 1 error generated.
make: *** [client.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/mysql2-0.5.5 for inspection.
Results logged to /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/extensions/arm64-darwin-22/3.2.0/mysql2-0.5.5/gem_make.out

  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:119:in `run'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:51:in `block in make'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:43:in `each'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:43:in `make'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/ext_conf_builder.rb:41:in `build'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:187:in `build_extension'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:221:in `block in build_extensions'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in `each'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in `build_extensions'
  /Users/mkrsvsky/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/installer.rb:843:in `build_extensions'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/rubygems_gem_installer.rb:72:in `build_extensions'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/source/rubygems.rb:202:in `install'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/installer/gem_installer.rb:54:in `install'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/installer/parallel_installer.rb:156:in `do_install'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/installer/parallel_installer.rb:147:in `block in worker_pool'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/worker.rb:62:in `apply_func'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/worker.rb:57:in `block in process_queue'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/worker.rb:54:in `loop'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/worker.rb:54:in `process_queue'
  /Users/mkrsvsky/.rvm/gems/ruby-3.2.2@tidyclub/gems/bundler-2.4.19/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing mysql2 (0.5.5), and Bundler cannot continue.

In Gemfile:
  mysql2

Someone can help me or give an advice?

@elistemann
Copy link

This happened to me too after brew updated mysql to 8.3. Seems like Percona Tools have the same issue:
https://perconadev.atlassian.net/jira/software/c/projects/PT/issues

As a workaround for now i downgraded MySQL to 8.0:


brew uninstall mysql
brew install [email protected]

Afterwards mysql2 installed without issues.

@mkrsvsky
Copy link
Author

mkrsvsky commented Feb 1, 2024

This happened to me too after brew updated mysql to 8.3. Seems like Percona Tools have the same issue: https://perconadev.atlassian.net/jira/software/c/projects/PT/issues

As a workaround for now i downgraded MySQL to 8.0:


brew uninstall mysql
brew install [email protected]

Afterwards mysql2 installed without issues.

This not working

@xjunior
Copy link
Contributor

xjunior commented Feb 1, 2024

This looks like a duplicate of #1346

@flavorjones
Copy link
Contributor

Fixed in v0.5.6, this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants