Closed artur79 closed 2 years ago
I think I overcome above error by setting:
bundle config build.or-tools --with-or-tools-dir=/opt/homebrew --with-cflags=CMAKE_CXX_STANDARD=14
I believe it's some c++ compilation setting, but got new error instead :)
Installing or-tools 0.3.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/or-tools-0.3.3/ext/or-tools
/Users/artur/.rbenv/versions/2.6.6/bin/ruby -I /Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0 -r ./siteconf20220404-23424-ymp984.rb extconf.rb --with-or-tools-dir\=/opt/homebrew
--with-cflags\=CMAKE_CXX_STANDARD\=14
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rice-4.0.3/lib/mkmf-rice.rb:16: warning: already initialized constant MakeMakefile::CONFTEST_C
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/mkmf.rb:259: warning: previous definition of CONFTEST_C was here
checking for rice/rice.hpp in /Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rice-4.0.3/include... no
*** 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/artur/.rbenv/versions/2.6.6/bin/$(RUBY_BASE_NAME)
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rice-4.0.3/lib/mkmf-rice.rb:120:in `<top (required)>': Could not find rice/rice.hpp header (RuntimeError)
from /Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require'
from /Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
from /Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
from extconf.rb:1:in `<main>'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- mkmf-rice (LoadError)
from /Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from extconf.rb:1:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/-darwin-21/2.6.0/or-tools-0.3.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/or-tools-0.3.3 for inspection.
Results logged to /Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/-darwin-21/2.6.0/or-tools-0.3.3/gem_make.out
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/ext/builder.rb:99:in `run'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/ext/ext_conf_builder.rb:47:in `block in build'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/tempfile.rb:295:in `open'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/ext/ext_conf_builder.rb:29:in `build'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/ext/builder.rb:185:in `block in build_extension'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/ext/builder.rb:181:in `build_extension'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/ext/builder.rb:229:in `block in build_extensions'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/ext/builder.rb:226:in `each'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/ext/builder.rb:226:in `build_extensions'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/installer.rb:830:in `build_extensions'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/rubygems_gem_installer.rb:71:in `build_extensions'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/rubygems_gem_installer.rb:28:in `install'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/source/rubygems.rb:200:in `install'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/installer/gem_installer.rb:54:in `install'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/installer/gem_installer.rb:59:in `block in install_with_settings'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/rubygems_integration.rb:575:in `install_with_build_args'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/installer/gem_installer.rb:59:in `install_with_settings'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/installer/parallel_installer.rb:186:in `do_install'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/worker.rb:62:in `apply_func'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/worker.rb:57:in `block in process_queue'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/worker.rb:54:in `loop'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/worker.rb:54:in `process_queue'
/Users/artur/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.31/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'
An error occurred while installing or-tools (0.3.3), and Bundler cannot continue.
In Gemfile:
or-tools
Hey @artur79, it looks like you're using an older version of the gem (0.3.3). Make sure you have the latest OR-Tools from Homebrew (9.2) and try version 0.6.3 of the gem (the latest version is 0.7.0, but it requires OR-Tools 9.3, which isn't on Homebrew yet).
@ankane works like a charm, thank you very much :) I think issue may be closed
Not caused by this gem but maybe someone already solved it. I'v followed instructions for README and when bundling received an error: