I'm trying to install the Jazzy Cocoapod so I can use it to document my Swift code. I have Cocoapods 0.35 successfully installed, but Jazzy will not install. I looked for the log files that should have been produced but they are not present. Here's the error message:
$ sudo gem install jazzy
Building native extensions. This could take a while...
ERROR: Error installing jazzy:
ERROR: Failed to build gem native extension.
/Users/scott/.rvm/rubies/ruby-2.0.0-p0/bin/ruby -r ./siteconf20150130-37462-1halfop.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
* 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/scott/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
--help
--clean
--use-system-libraries
/Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- openssl (LoadError)
from /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/https.rb:22:in <top (required)>'
from /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require'
from /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/mini_portile-0.6.1/lib/mini_portile.rb:3:in'
from /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:in require'
from /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:inrescue in require'
from /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:39:in require'
from extconf.rb:395:in'
extconf failed, exit code 1
Gem files will remain installed in /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Users/scott/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/extensions/x86_64-darwin-12/2.0.0-static/nokogiri-1.6.6.2/gem_make.out
Can anybody help me decipher this? Thank you.
Try running the following first:
xcode-select install
This solved the issue for me.
Update: I just saw how old this question was, but I guess it doesn't matter :).
Related
This happened to me several times while trying to install Discourse:
Cannot install rbtrace with native extensions.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
*** 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/setoelka/.rbenv/versions/2.7.3/bin/$(RUBY_BASE_NAME)
extconf.rb:6:in `sys': make install failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError)
from extconf.rb:43:in `block (2 levels) in <main>'
from extconf.rb:34:in `chdir'
from extconf.rb:34:in `block in <main>'
from extconf.rb:30:in `chdir'
from extconf.rb:30:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rbtrace-0.4.14/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rbtrace-0.4.14 for inspection.
Results logged to /Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rbtrace-0.4.14/gem_make.out
An error occurred while installing rbtrace (0.4.14), and Bundler cannot continue.
Make sure that `gem install rbtrace -v '0.4.14' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rbtrace
Does anyone know about the problem? I tried running:
gem install rbtrace -v '0.4.14' --source 'http://rubygems.org/' -- --with-cflags=-Wno-implicit-function-declaration
No luck so far.
I solved this problem by myself by looking at the mkmf.log content.
TLDR;
Use the selected Xcode with standar naming, i.e, Xcode.app.
It turned out that Ruby will compile the gem using the compiler from the default Xcode. I have multiple version of Xcodes and use the xcode-select to switch between them.
The thing is, the ruby setup will always looking for the default Xcode.app naming. If you name your selected Xcode something else, you'll get this error.
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)
Ruby version 2.2.4p230
RubyGem version 2.7.2
Ruby-devel and lib64ffi-devel installed.
64-bit OpenMandriva 3.0, urpmi and rpmdrake used.
Goal: to install compass, but the gem ffi is needed first.
I have scoured the internet so hard for the last two days and I'm so stumped... It's impossible for me to install an earlier version of ruby because of the dependency for an older ncurses. I feel like replacing ncurses would open a can of nasty worms.
However... I am also completely open to a compass alternative, where the config.rb project files could be somehow ported / copied so both compass and this other sass compiler could operate. (this is for work and we're not changing the sass builder any time soon).
/usr/share/gems/gems/ffi-1.9.18/ext/ffi_c totally exists, there is an ffi.c file in that directory but can't find any ffi.h file in the vicinity. In a moment of desperation I touched ffi.h in that dir and when I ran gem install it removed it. ;) I would try taking a copy of someone else's libs to see if that works.
Basically any way to get this working without breaking the rest of my packages. I don't use ruby for anything else, just compass.
Here is the output:
# sudo gem install ffi
Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.
current directory: /usr/share/gems/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby -r ./siteconf20171110-17988-1lodsok.rb extconf.rb
checking for ffi.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)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib64
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/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:587:in `try_cpp'
from /usr/share/ruby/mkmf.rb:1060:in `block in have_header'
from /usr/share/ruby/mkmf.rb:911:in `block in checking_for'
from /usr/share/ruby/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/share/ruby/mkmf.rb:321:in `open'
from /usr/share/ruby/mkmf.rb:351:in `block in postpone'
from /usr/share/ruby/mkmf.rb:321:in `open'
from /usr/share/ruby/mkmf.rb:347:in `postpone'
from /usr/share/ruby/mkmf.rb:910:in `checking_for'
from /usr/share/ruby/mkmf.rb:1059:in `have_header'
from extconf.rb:16:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/lib64/gems/ruby/ffi-1.9.18/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/share/gems/gems/ffi-1.9.18 for inspection.
Results logged to /usr/lib64/gems/ruby/ffi-1.9.18/gem_make.out
Any help appreciated!
Your error message shows:
/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.
And that's how you can solve it:
xcode-select --install
(but make sure beforehand that xcode-select -p is returning the path to a stable Xcode version, like Xcode 10)
See also https://github.com/ffi/ffi/issues/647.
While trying to do "bundle install", I receive error message below
environment = OSX 10.9.4, rbenv 0.4.0,
ruby 2.1.2,
Homebrew 0.9.5
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/hirotakagotanda/.rbenv/versions/2.1.2/bin/ruby 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=/Users/hirotakagotanda/.rbenv/versions/2.1.2/bin/ruby
/Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in `stat': No such file or directory # rb_file_s_stat - ./212/ruby_debug.h (Errno::ENOENT)
from /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in `block in fu_each_src_dest'
from /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1587:in `fu_each_src_dest0'
from /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1571:in `fu_each_src_dest'
from /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:399:in `cp'
from extconf.rb:83:in `block in <main>'
from extconf.rb:82:in `each'
from extconf.rb:82:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/debugger-1.6.6 for inspection.
Results logged to /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/debugger-1.6.6/gem_make.out
An error occurred while installing debugger (1.6.6), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.6'` succeeds before bundling.
Could anyone please provide me solution, I have been misfortunate to find out any...
This is likely a problem with the Xcode Command Line Tools. There are a number of steps needed to get this right.
This question Installing Ruby Debug IDE Gem provides one example.
I ran into the same issue and solved it by agreeing to xcode's license (it seems to happen after an update and you haven't yet agreed to the update)
Just run xcodebuild -license from the command line
Found the answer thanks to this question
Neither of the above comments helped me. Changing to ruby 2.1.1 of below allowed me to bundle without issue.
rbenv local 2.1.1
bundle install
using ruby 2.1.2, it breaks in the same place
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 :)