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

Failed to build gem native extension - unknown type name 'my_bool' #980

Closed
PandaWhisperer opened this issue Jun 18, 2018 · 1 comment
Closed

Comments

@PandaWhisperer
Copy link

Problem

My Rails app was having issues connecting to my database this morning (unfortunately I don't have the error message anymore), so I decided to reinstall the msyql2 gem. This failed with the following error message:

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

    current directory: /Users/christoph/.rvm/gems/ruby-2.2.9@cloudcma/gems/mysql2-0.4.3/ext/mysql2
/Users/christoph/.rvm/rubies/ruby-2.2.9/bin/ruby -r ./siteconf20180618-59236-1dwk0nr.rb extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Using mysql_config at /usr/local/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Setting rpath to /usr/local/Cellar/mysql/8.0.11/lib
-----
creating Makefile

current directory: /Users/christoph/.rvm/gems/ruby-2.2.9@cloudcma/gems/mysql2-0.4.3/ext/mysql2
make "DESTDIR=" clean

current directory: /Users/christoph/.rvm/gems/ruby-2.2.9@cloudcma/gems/mysql2-0.4.3/ext/mysql2
make "DESTDIR="
compiling infile.c
In file included from infile.c:1:
In file included from ./mysql2_ext.h:41:
./result.h:24:3: error: unknown type name 'my_bool'
  my_bool *is_null;
  ^
./result.h:25:3: error: unknown type name 'my_bool'
  my_bool *error;
  ^
2 errors generated.
make: *** [infile.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/christoph/.rvm/gems/ruby-2.2.9@cloudcma/gems/mysql2-0.4.3 for inspection.
Results logged to /Users/christoph/.rvm/gems/ruby-2.2.9@cloudcma/extensions/x86_64-darwin-17/2.2.0/mysql2-0.4.3/gem_make.out

An error occurred while installing mysql2 (0.4.3), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.4.3'` succeeds before bundling.

System Specs

This is on a MacBook Pro, OS X 10.13.3 (High Sierra), mysql 8.0.11 installed via homebrew.

Interestingly, I've had the same version of the gem installed on this very same computer before, so it must have been able to compile at some point. Not sure what happened in the meantime that would break it.

Steps taken so far

  • Uninstalled and re-installed mysql2 gem
  • Uninstalled and re-installed mysql

I also tried upgrading the gem to a newer version (0.5.1 installs without a hitch), but the app I'm using it with is a Rails 4 app, and according to #950 that means I have to stick to the 0.4.x release.

@PandaWhisperer
Copy link
Author

Update: looks like version 0.4.10 installs cleanly.

khiav223577 pushed a commit to khiav223577/atomically that referenced this issue Aug 19, 2023
See: brianmario/mysql2#980

Error messages:

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

...

compiling client.c
client.c: In function ‘nogvl_read_query_result’:
client.c:439:3: error: unknown type name ‘my_bool’; did you mean ‘_Bool’?
  439 |   my_bool res = mysql_read_query_result(client);
      |   ^~~~~~~
      |   _Bool
client.c: In function ‘rb_query’:
This issue was 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

1 participant