brianmario / charlock_holmes

Character encoding detection, brought to you by ICU
MIT License
1.04k stars 141 forks source link

Installation breaks on Mojave #139

Open mcandre opened 5 years ago

mcandre commented 5 years ago

Trace:

$ bundle config build.charlock_holmes --with-icu-dir /usr/local/opt/icu4c
$ bundle install
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/.
Resolving dependencies...
Using rake 10.5.0
Using arrayfields 4.9.2
Using ast 2.4.0
Using builder 3.2.3
Using bundler 1.16.2
Using parallel 1.12.1
Using cane 2.6.2
Fetching charlock_holmes 0.7.6
Installing charlock_holmes 0.7.6 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/usr/local/lib/ruby/gems/2.5.0/gems/charlock_holmes-0.7.6/ext/charlock_holmes
/usr/local/opt/ruby/bin/ruby -r ./siteconf20190101-8593-1j6ubma.rb extconf.rb
--with-icu-dir /usr/local/opt/icu4c
*** 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
    --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=/usr/local/Cellar/ruby/2.5.3/bin/$(RUBY_BASE_NAME)
    --with-icu-dir
/usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/mkmf.rb:1741:in `dir_config': undefined
method `split' for true:TrueClass (NoMethodError)
    from extconf.rb:24:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in
/usr/local/lib/ruby/gems/2.5.0/gems/charlock_holmes-0.7.6 for inspection.
Results logged to
/usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0/charlock_holmes-0.7.6/gem_make.out

An error occurred while installing charlock_holmes (0.7.6), and Bundler cannot
continue.
Make sure that `gem install charlock_holmes -v '0.7.6' --source 'http://rubygems.org/'`
succeeds before bundling.
oiahoon commented 5 years ago

same

$ gem install charlock_holmes -v '0.7.6' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR:  Error installing charlock_holmes:
    ERROR: Failed to build gem native extension.

    current directory: /Users/onice/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/charlock_holmes-0.7.6/ext/charlock_holmes
/Users/onice/.rbenv/versions/2.3.6/bin/ruby -I /Users/onice/.rbenv/versions/2.3.6/lib/ruby/site_ruby/2.3.0 -r ./siteconf20190422-12714-1eiazht.rb extconf.rb
checking for main() in -licui18n... yes
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... no

***************************************************************************************
*********** icu required (brew install icu4c or apt-get install libicu-dev) ***********
***************************************************************************************
*** 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/onice/.rbenv/versions/2.3.6/bin/$(RUBY_BASE_NAME)
    --with-icu-dir
    --without-icu-dir
    --with-icu-include
    --without-icu-include=${icu-dir}/include
    --with-icu-lib
    --without-icu-lib=${icu-dir}/lib
    --with-icui18nlib
    --without-icui18nlib
    --with-icui18nlib
    --without-icui18nlib

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

  /Users/onice/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/charlock_holmes-0.7.6/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/onice/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/charlock_holmes-0.7.6 for inspection.
Results logged to /Users/onice/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/charlock_holmes-0.7.6/gem_make.out
ritxi commented 5 years ago

It builds perfect with the following:

gem install charlock_holmes -- --with-icu-dir=/usr/local/opt/icu4c --with-cxxflags=-std=c++11

tragiclifestories commented 5 years ago

not for me ...

$ bundle exec gem install charlock_holmes -v '0.7.6' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR:  Error installing charlock_holmes:
        ERROR: Failed to build gem native extension.

    current directory: /Users/jamesturley/Documents/ruby/ch/vendor/bundle/ruby/2.5.0/gems/charlock_holmes-0.7.6/ext/charlock_holmes
/opt/boxen/rbenv/versions/2.5.5/bin/ruby -r ./siteconf20190625-73172-e35q4a.rb extconf.rb
/opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find charlock_holmes-0.7.6 in any of the sources (Bundler::GemNotFound)
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:85:in `map!'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:85:in `materialize'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/definition.rb:170:in `specs'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/definition.rb:237:in `specs_for'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/definition.rb:226:in `requested_specs'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:108:in `block in definition_method'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:20:in `setup'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler.rb:107:in `setup'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/setup.rb:20:in `<top (required)>'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        from /opt/boxen/rbenv/versions/2.5.5/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'

extconf failed, exit code 1

Gem files will remain installed in /Users/jamesturley/Documents/ruby/ch/vendor/bundle/ruby/2.5.0/gems/charlock_holmes-0.7.6 for inspection.
Results logged to /Users/jamesturley/Documents/ruby/ch/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/charlock_holmes-0.7.6/gem_make.out
JoaquinJimenezGarcia commented 3 years ago

Hi @tragiclifestories ! For me it worked after installing zlib1g-dev