I installed pkg-config and imagemagick:
brew install pkg-config imagemagick#6
Imagemagick version
identify -version
Version: ImageMagick 6.9.12-28 Q16 arm 2021-10-29 https://imagemagick.org
When trying to install rmagick
gem install rmagick
I get
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /opt/homebrew/lib/ruby/gems/3.0.0/gems/rmagick-4.2.3/ext/RMagick
/opt/homebrew/opt/ruby/bin/ruby -I /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0 -r ./siteconf20211112-33588-cd2c64.rb extconf.rb
checking for brew... yes
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes
/opt/homebrew/Library/Homebrew/shims/mac/super/pkg-config: line 9: /pkg-config/bin/pkg-config: No such file or directory
/opt/homebrew/Library/Homebrew/shims/mac/super/pkg-config: line 9: exec: /pkg-config/bin/pkg-config: cannot execute: No such file or directory
ERROR: Can't install RMagick 4.2.3.
Can't find the ImageMagick library or one of the dependent libraries.
Check the mkmf.log file for more detailed information.
*** 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=/opt/homebrew/Cellar/ruby/3.0.2_1/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/opt/homebrew/lib/ruby/gems/3.0.0/extensions/arm64-darwin-20/3.0.0/rmagick-4.2.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /opt/homebrew/lib/ruby/gems/3.0.0/gems/rmagick-4.2.3 for inspection.
Results logged to /opt/homebrew/lib/ruby/gems/3.0.0/extensions/arm64-darwin-20/3.0.0/rmagick-4.2.3/gem_make.out
So I created a folder /opt/homebrew/Library/Homebrew/shims/mac/super/pkg-config/bin/ containing a symbolic link
ln -s /opt/homebrew/opt/pkg-config/bin/pkg-config pkg-config
And now when trying to install rmagick I get:
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /opt/homebrew/lib/ruby/gems/3.0.0/gems/rmagick-4.2.3/ext/RMagick
/opt/homebrew/opt/ruby/bin/ruby -I /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0 -r ./siteconf20211112-33523-27c8up.rb extconf.rb
checking for brew... yes
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes
checking for outdated ImageMagick version (<= 6.7.7)... no
checking for clang... yes
Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
/opt/homebrew/opt/imagemagick#6/bin/Magick-config reports version 6.9.12-28 Q16 is installed in /opt/homebrew/Cellar/imagemagick#6/6.9.12-28
/opt/homebrew/bin/Magick-config reports version 6.9.12-28 Q16 is installed in /opt/homebrew/Cellar/imagemagick#6/6.9.12-28
Using 6.9.12-28 Q16 from /opt/homebrew/Cellar/imagemagick#6/6.9.12-28.
checking for __GNUC__... *** 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=/opt/homebrew/Cellar/ruby/3.0.2_1/bin/$(RUBY_BASE_NAME)
/opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:471:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:597:in `block in try_compile'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:546:in `with_werror'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:597:in `try_compile'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:864:in `macro_defined?'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:1006:in `block in have_macro'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:971:in `block in checking_for'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:331:in `open'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:361:in `block in postpone'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:331:in `open'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:357:in `postpone'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:970:in `checking_for'
from /opt/homebrew/Cellar/ruby/3.0.2_1/lib/ruby/3.0.0/mkmf.rb:1005:in `have_macro'
from extconf.rb:99:in `configure_compile_options'
from extconf.rb:19:in `initialize'
from extconf.rb:398:in `new'
from extconf.rb:398:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/opt/homebrew/lib/ruby/gems/3.0.0/extensions/arm64-darwin-20/3.0.0/rmagick-4.2.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /opt/homebrew/lib/ruby/gems/3.0.0/gems/rmagick-4.2.3 for inspection.
Results logged to /opt/homebrew/lib/ruby/gems/3.0.0/extensions/arm64-darwin-20/3.0.0/rmagick-4.2.3/gem_make.out
It is specified I have to install development tools so I checked if it was installed:
gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I've been searching for a long time now and found several topics dealing with similar issues but none of them could help me...
Do you have an idea why this doesn't work ?
I'm using Mac OSX 11.6, ruby 3.0.2p107
Thanks a lot
Okay just by restarting the mac, uninstalling and reinstalling everything I managed to install rmagick v4.2.3.
Uninstall
brew uninstall pkg-config imagemagick#6
Reinstall
brew install pkg-config imagemagick#6
And installed Rmagick
gem install rmagick
I already tried to uninstall and reinstall before but without restarting the mac and the Rmagick installation was failing in the same way... So it seems that restart was needed, maybe one of the paths or environment variables needed this to be set properly for Rmagick...
Related
Use root user installed rubygems.
# yum install rubygems -y
When check ruby's version, got
# ruby -v
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux]
Gem's version:
# gem -v
2.7.6.3
When install a gem, got
# gem install fluent-plugin-kinesis
Building native extensions. This could take a while...
ERROR: Error installing fluent-plugin-kinesis:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/msgpack-1.4.2/ext/msgpack
/usr/bin/ruby -r ./siteconf20210825-20925-17fyw57.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/msgpack-1.4.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/msgpack-1.4.2/gem_make.out
Should I install a high version ruby? It's the default one on the system.
update
I installed ruby-devel
# yum install ruby-devel.x86_64
Run install fluent-plugin-kinesis gem again
# gem install fluent-plugin-kinesis
Building native extensions. This could take a while...
ERROR: Error installing fluent-plugin-kinesis:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/msgpack-1.4.2/ext/msgpack
/usr/bin/ruby -r ./siteconf20210826-11878-18i9eps.rb extconf.rb
checking for ruby/st.h... *** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:590:in `try_cpp'
from /usr/share/ruby/mkmf.rb:1098:in `block in have_header'
from /usr/share/ruby/mkmf.rb:948:in `block in checking_for'
from /usr/share/ruby/mkmf.rb:350:in `block (2 levels) in postpone'
from /usr/share/ruby/mkmf.rb:320:in `open'
from /usr/share/ruby/mkmf.rb:350:in `block in postpone'
from /usr/share/ruby/mkmf.rb:320:in `open'
from /usr/share/ruby/mkmf.rb:346:in `postpone'
from /usr/share/ruby/mkmf.rb:947:in `checking_for'
from /usr/share/ruby/mkmf.rb:1097:in `have_header'
from extconf.rb:3:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib64/gems/ruby/msgpack-1.4.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/msgpack-1.4.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/msgpack-1.4.2/gem_make.out
For other gems works well.
Take a look at the docs or this answer.
Install Ruby >= 2.4 on your local environment. In addition, install ruby-dev package via Package Manager to build native extension gems.
I believe in CentOS ruby-dev equivalent is ruby-devel. You can confirm it by running yum search ruby-dev
You'll find 2 packages, one i686 and another x86_64. You can find which one you need by running lscpu | grep Arch.
Then simply download the package, and rerun gem install
Went thru many blogs in stackoverflow inorder to install rmagick but didnt find a solution. Any help is much appreciated.
Tried using uninstalling and reinstalling imagemagick. Flow some links like Install rmagick
Here is the output
sudo gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/rmagick-
2.16.0/ext/RMagick
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r
./siteconf20181206-50407-46eq96.rb extconf.rb
checking for xcrun... yes
checking for Magick-config... yes
checking for outdated ImageMagick version (<= 6.4.9)... no
checking for presence of MagickWand API (ImageMagick version >=
6.9.0)... 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=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
extconf.rb:104:in ``': No such file or directory - MagickWand-config
(Errno::ENOENT)
from extconf.rb:104:in `configure_compile_options'
from extconf.rb:16:in `initialize'
from extconf.rb:548:in `new'
from extconf.rb:548:in `<main>'
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/rmagick-2.16.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/Library/Ruby/Gems/2.3.0/gems/rmagick-2.16.0 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-
darwin-18/2.3.0/rmagick-2.16.0/gem_make.out
If you've installed Imagemagick per the instructions in your link, your shell may missing the path to the binaries. You can test by running a console command:
which MagickWand-config
If it returns a path (likely /usr/local/bin/MagickWand-config) your path is probably fine. If it returns MagickWand-config not found you should be able to type export PATH=/usr/local/bin:$PATH in your console.
If your path wasn't correct before, after running the export command you can re-run the which MagickWand-config command to confirm it's in your path. Then try to gem install rmagick again.
I was able to install rmagick on Mojave following the link you posted.
If this did fix your issue you'll also want to add the export command I noted in your ~/.bash_profile or ~/.zsh_profile file so that path is prepended in every terminal window (if it's not there already)
I have installer ruby 2.3.1 ruby.devkit 4.5.2.20120101 from the chocolately repostory on windows 10
then i have modified conf.yml and run:
PS C:\tools\DevKit> ruby dk.rb install --force
[WARN] Updating (with backup) existing gem override for 'C:/tools/ruby23'
[WARN] Updating (with backup) DevKit helper library for 'C:/tools/ruby23'
All seem to me ok, but when I try to update gems, some of them show the following errors:
PS C:\tools\DevKit> gem update
Updating installed gems
Updating bigdecimal
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing bigdecimal:
ERROR: Failed to build gem native extension.
current directory: C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bigdecimal-1.3.0/ext/bigdecimal
C:/tools/ruby23/bin/ruby.exe -r ./siteconf20170106-4004-rogg3v.rb extconf.rb
checking for labs() in stdlib.h... *** 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=C:/tools/ruby23/bin/$(RUBY_BASE_NAME)
C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:541:in `try_link0'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:765:in `try_func'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:1051:in `block in have_func'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:1050:in `have_func'
from extconf.rb:6:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/tools/ruby23/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/bigdecimal-1.3.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bigdecimal-1.3.0 for inspection.
Results logged to C:/tools/ruby23/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/bigdecimal-1.3.0/gem_make.out
Updating did_you_mean
ERROR: Error installing did_you_mean:
did_you_mean requires Ruby version >= 2.4.0dev.
Updating io-console
Building native extensions. This could take a while...
ERROR: Error installing io-console:
ERROR: Failed to build gem native extension.
current directory: C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/io-console-0.4.6
C:/tools/ruby23/bin/ruby.exe -r ./siteconf20170106-4004-impy5k.rb extconf.rb
*** 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=C:/tools/ruby23/bin/$(RUBY_BASE_NAME)
C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:524:in `with_werror'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:571:in `try_compile'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:835:in `macro_defined?'
from extconf.rb:7:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/tools/ruby23/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/io-console-0.4.6/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/io-console-0.4.6 for inspection.
Results logged to C:/tools/ruby23/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/io-console-0.4.6/gem_make.out
Updating json
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
current directory: C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/json-2.0.2/ext/json/ext/generator
C:/tools/ruby23/bin/ruby.exe -r ./siteconf20170106-4004-dmzeq3.rb extconf.rb
creating Makefile
current directory: C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/json-2.0.2/ext/json/ext/generator
make "DESTDIR=" clean
current directory: C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/json-2.0.2/ext/json/ext/generator
make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
make: x86_64-w64-mingw32-gcc: Command not found
make: *** [generator.o] Error 127
make failed, exit code 2
Gem files will remain installed in C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/json-2.0.2 for inspection.
Results logged to C:/tools/ruby23/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/json-2.0.2/gem_make.out
Updating psych
Building native extensions. This could take a while...
ERROR: Error installing psych:
ERROR: Failed to build gem native extension.
current directory: C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/psych-2.2.2/ext/psych
C:/tools/ruby23/bin/ruby.exe -r ./siteconf20170106-4004-1rx9fhh.rb extconf.rb
checking for yaml.h... *** 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=C:/tools/ruby23/bin/$(RUBY_BASE_NAME)
--with-libyaml-dir
--without-libyaml-dir
--with-libyaml-include
--without-libyaml-include=${libyaml-dir}/include
--with-libyaml-lib
--without-libyaml-lib=${libyaml-dir}/lib
--enable-bundled-libyaml
--disable-bundled-libyaml
C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:587:in `try_cpp'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:1144:in `block in find_header'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from C:/tools/ruby23/lib/ruby/2.3.0/mkmf.rb:1143:in `find_header'
from extconf.rb:10:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/tools/ruby23/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/psych-2.2.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/psych-2.2.2 for inspection.
Results logged to C:/tools/ruby23/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/psych-2.2.2/gem_make.out
Gems updated: bigdecimal did_you_mean io-console json psych
i realy can't understand what is happen, any idea?
tl;dr - you should install ruby2.devkit instead.
In https://stackoverflow.com/a/41511890/18475 answer, it says that the ruby.devkit package is out of date. It's not, it just applies to a different Ruby.
Incorrect Package
You maybe missed this from https://chocolatey.org/packages/ruby.devkit:
As opposed to Ruby v2 DevKit (https://chocolatey.org/packages/ruby2.devkit):
You installed the incorrect package - https://chocolatey.org/packages/ruby2.devkit is the one you are looking for.
The compiler changed for Ruby v2+ for Ruby on Windows, which means you need to use the proper compilers. That DevKit is in the ruby2.devkit package.
Don't Forget to Refresh Your Environment
If you are using Chocolatey, you get refreshenv as a command you can call in cmd.exe or powershell.exe (With PowerShell, be sure you have tab completion in your profile so that the proper refreshenv is available).
Otherwise you will need to close and reopen your shell for the updated PATHs to happen.
More Details
Head out to http://rubyinstaller.org/downloads/:
More Fun With Ruby
Here's a gist that does a complete Ruby stack setup: https://gist.github.com/ferventcoder/947479688d930e28d632
It's a bit outdated, so here is an update (PowerShell):
# https://github.com/chocolatey/choco/wiki/CommandsReference#how-to-pass-options--switches
# Powershell specific argument passing
# You must be on the latest beta of chocolatey for this to work properly (redownload files)
choco upgrade chocolatey -y
$originalPath = $env:PATH
choco install ruby --version 2.1.8 -my -x86 --install-arguments '/verysilent /dir=""c:\tools\ruby21"" /tasks=""assocfiles""' --override-arguments
choco install ruby --version 2.1.8 -fmy --install-arguments '/verysilent /dir=""c:\tools\ruby21-x64"" /tasks=""assocfiles""' --override-arguments
choco install ruby --version 2.3.1 -my -x86 --install-arguments '/verysilent /dir=""c:\tools\ruby23"" /tasks=""assocfiles""' --override-arguments
choco install ruby --version 2.3.1 -fmy --install-arguments '/verysilent /dir=""c:\tools\ruby23-x64"" /tasks=""assocfiles,modpath""' --override-arguments
Write-Output "Attempting Good DevKit2 Installations"
# DevKit for Ruby 2.x x64
$env:PATH=$originalPath
choco install ruby2.devkit -y
Move-Item c:\tools\DevKit2 C:\tools\DevKit2-x64 -Force -EA Continue
# DevKit for Ruby 2.x x86
choco install ruby2.devkit -y -x86 -f
Write-Output "Fixing DevKit Installations"
#"
---
- c:/tools/ruby21
- c:/tools/ruby23
"# | Out-File c:\tools\DevKit2\config.yml -Force -Encoding UTF8
pushd c:\tools\DevKit2
ruby dk.rb install -f
popd
#"
---
- c:/tools/ruby21-x64
- c:/tools/ruby23-x64
"# | Out-File c:\tools\DevKit2-x64\config.yml -Force -Encoding UTF8
pushd c:\tools\DevKit2-x64
ruby dk.rb install -f
popd
choco install pik -y
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby21\bin
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby21-x64\bin
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby23\bin
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby23-x64\bin
The important part in the error messages is:
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
In order to install compiled gems, you need a compiler installed. For Windows, you can install the Ruby DeveloperKit.
While you have it installed apparently, it doesn't seem to be recognized. This can have one of various reasons, the most common being the devkit not matching your ruby version or issues with the %PATH.
Recently I've updated my Mac to El Capitan and re-installed (with Homebrew) ImageMagick 6.9.2-7
Unfortunately bundle install doesn't work because RMagick fails to build.
Here the stack trace:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/me/.rvm/rubies/ruby-1.9.3-p327/bin/ruby -r ./siteconf20151204-39308-uw4m6y.rb extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/local/opt/gcc46/bin/gcc-4.6... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... *** 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=/Users/me/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from extconf.rb:194:in `<main>'
extconf failed, exit code 1
I've tried several different solutions founded on Internet but nothing seems to fix this error.
With the operations below I receive always the errore above:
1) C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.9.2-7/include/ImageMagick-6/ gem install rmagick -v '2.13.2'
2) gem install rmagick --version=2.13.2 --platform=ruby -- --with-opt-lib="h:/ImageMagick-6.9.2-7/lib" --with-opt-include="h:/ImageMagick-6.9.2-7/include"
3) $ cd /usr/local/Cellar/imagemagick/6.9.2-7/lib
$ ln -s libMagick++-Q16.6.dylib libMagick++.dylib
$ ln -s libMagickCore-Q16.2.dylib libMagickCore.dylib
$ ln -s libMagickWand-Q16.2.dylib libMagickWand.dylib
The error still the same:
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
I've also updated xcoce to 7.1.1
I'm using ruby-1.9.3-p327 with RVM
Thanks in advance.
You need to update Xcode and install Command Line Tools (xcode-select --install).
None of these worked in isolation for me, but the running of all of them seemed to do the trick:
xcode-select --install
brew unlink imagemagick
brew uninstall --force imagemagick
brew update
brew doctor
brew install imagemagick
That's likely overkill but in the end worked for me.
I am trying to install charlock holmes, nevertheless, I keep getting an error:
[root#hugovm gitlab]# gem install charlock_holmes --version '0.6.9.4'
Building native extensions. This could take a while...
ERROR: Error installing charlock_holmes:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for main() in -licui18n... yes
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... yes
-- tar zxvf file-5.08.tar.gz
-- ./configure --prefix=/usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/dst/ --disable-shared --enable-static --with-pic
-- patch -p0 < ../file-soft-check.patch
*** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-icu-dir
--without-icu-dir
--with-icu-include
--without-icu-include=${icu-dir}/include
--with-icu-lib
--without-icu-lib=${icu-dir}/
--with-icui18nlib
--without-icui18nlib
--with-icui18nlib
--without-icui18nlib
extconf.rb:7:in `sys': patch -p0 < ../file-soft-check.patch failed, please report issue on http://github.com/brianmario/charlock_holmes (RuntimeError)
from extconf.rb:61:in `block (2 levels) in <main>'
from extconf.rb:59:in `chdir'
from extconf.rb:59:in `block in <main>'
from extconf.rb:55:in `chdir'
from extconf.rb:55:in `<main>'
Gem files will remain installed in /usr/local/share/gems/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/gem_make.out
I already installed libicu-devel.
Thanks
I had the exact same issue today. Tried to install gitlab on a clean fedora machine.
For me, a line in /usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/gem_make.out pointed to mkmf.log, which is in the same directory as above log file.
There it said "patch: command not found"
sudo yum install patch
In you output I can read:
extconf.rb:7:in `sys': patch -p0 < ../file-soft-check.patch failed, please report issue on http://github.com/brianmario/charlock_holmes (RuntimeError)
So it all points to a bug. I suppose it is a good idea follow the output and created an issue there, explaining what you are trying to do and giving details of your environment.
ruby-devel is missing
yum install ruby-devel
and you'll be set :)