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

Error when installing on macOS Big Sur 11.2 #69

Closed
ludomout opened this issue Feb 3, 2021 · 9 comments
Closed

Error when installing on macOS Big Sur 11.2 #69

ludomout opened this issue Feb 3, 2021 · 9 comments

Comments

@ludomout
Copy link

ludomout commented Feb 3, 2021

When I try to install

gem install cairo

I get the following output:

Building native extensions. This could take a while...
ERROR:  Error installing cairo:
	ERROR: Failed to build gem native extension.

    current directory: /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cairo-1.17.4/ext/cairo
/Users/ludo/.rbenv/versions/2.7.1/bin/ruby -I /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/2.7.0 -r ./siteconf20210203-60976-1miwu3o.rb extconf.rb
checking for GCC... yes
checking for Homebrew... yes
checking for cairo version (>= 1.2.0)... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/ludo/.rbenv/versions/2.7.1/bin/$(RUBY_BASE_NAME)
	--with-pkg-config
	--without-pkg-config
	--with-override-variables
	--without-override-variables
/Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:389:in `parse_pc': .pc doesn't exist: <expat> (PackageConfig::NotFoundError)
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:233:in `declaration'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:178:in `requires_private'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:504:in `block in all_required_packages'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:259:in `collect_requires'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:265:in `block in collect_requires'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:260:in `each'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:260:in `collect_requires'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:265:in `block in collect_requires'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:260:in `each'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:260:in `collect_requires'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:503:in `all_required_packages'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:283:in `collect_cflags'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:191:in `cflags_only_other'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:564:in `cflags_only_other'
	from /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pkg-config-1.4.4/lib/pkg-config.rb:611:in `have_package'
	from extconf.rb:42:in `required_pkg_config_package'
	from extconf.rb:50:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-20/2.7.0/cairo-1.17.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cairo-1.17.4 for inspection.
Results logged to /Users/ludo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-20/2.7.0/cairo-1.17.4/gem_make.out

The mkmf.log file contains the following:

checking for GCC... -------------------- yes

"clang -o conftest -I/Users/ludo/.rbenv/versions/2.7.1/include/ruby-2.7.0/x86_64-darwin20 -I/Users/ludo/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/backward -I/Users/ludo/.rbenv/versions/2.7.1/include/ruby-2.7.0 -I. -I/Users/ludo/.rbenv/versions/2.7.1/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens  -fno-common -pipe conftest.c  -L. -L/Users/ludo/.rbenv/versions/2.7.1/lib -L. -L/Users/ludo/.rbenv/versions/2.7.1/lib  -fstack-protector-strong -L/usr/local/lib     -lruby.2.7   "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

"clang -I/Users/ludo/.rbenv/versions/2.7.1/include/ruby-2.7.0/x86_64-darwin20 -I/Users/ludo/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/backward -I/Users/ludo/.rbenv/versions/2.7.1/include/ruby-2.7.0 -I. -I/Users/ludo/.rbenv/versions/2.7.1/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens  -fno-common -pipe   -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: #ifndef __GNUC__
5: # error
6: |:/ === __GNUC__ undefined === /:|
7: #endif
/* end */

--------------------

checking for Homebrew... -------------------- yes

--------------------

have_package: checking for cairo version (>= 1.2.0)... -------------------- yes

--------------------

Error since updating to big sur 11.2
Any idea on how to fix this ?

@ludomout ludomout changed the title Error when installing on mac Big Sur 11.2 Error when installing on macOS Big Sur 11.2 Feb 3, 2021
@kou
Copy link
Member

kou commented Feb 4, 2021

I think that you need to reinstall all your Homebrew Formulae after you update your macOS.

@ludomout
Copy link
Author

ludomout commented Feb 4, 2021

I have already upgraded formulae without success.

@kou
Copy link
Member

kou commented Feb 4, 2021

I have already upgraded formulae without success.

Does this mean that you failed to upgrade formulae? If so, it may be the problem.

@ludomout
Copy link
Author

ludomout commented Feb 4, 2021

I have already upgraded formulae without success.

Does this mean that you failed to upgrade formulae? If so, it may be the problem.

Upgrade formulae successful but always the error gem install cairo

@kou
Copy link
Member

kou commented Feb 4, 2021

Could you show output of the following command lines?

which pkg-config
pkg-config --debug --list-all
pkg-config --debug --cflags --libs cairo
pkg-config --debug --modversion cairo
pkg-config --debug --cflags --libs expat

@ludomout
Copy link
Author

ludomout commented Feb 4, 2021

which pkg-config /usr/local/bin/pkg-config

pkg-config --debug --list-all
https://gist.github.com/ludomout/f7efffaee90d9d26b57d203c4224e7a2

pkg-config --debug --cflags --libs cairo
https://gist.github.com/ludomout/aac204510ed91e36b202f1b24877be44

pkg-config --debug --modversion cairo
https://gist.github.com/ludomout/2a6eab4b34b2e046046603d68e701d21

pkg-config --debug --cflags --libs expat
https://gist.github.com/ludomout/112e570368ee0bde7d118fe815624420

kou added a commit to ruby-gnome/pkg-config that referenced this issue Feb 4, 2021
GitHub: rcairo/rcairo#69

Homebrew uses Library/Homebrew/os/mac/pkgconfig/11 instead of
.../11.2.

Reported by Ludovic Moutury. Thanks!!!
@kou
Copy link
Member

kou commented Feb 4, 2021

Could you try gem install pkg-config; gem install cairo?

@ludomout
Copy link
Author

ludomout commented Feb 4, 2021

All's good now.
Thank you :-)

@ludomout ludomout closed this as completed Feb 4, 2021
@RobertDober
Copy link

Thank you for this really quick fix <3

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Feb 5, 2021
== 1.4.5 - 2021-02-04

=== Improvements

  * Added support for macOS 11.2.
    [Reported by Ludovic Moutury][GitHub:rcairo/rcairo#69]

=== Thanks

  * Ludovic Moutury
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

3 participants