Error while installing iconv on windows by ruby2.0.0 - ruby

Error while installing iconv on windows by ruby2.0.0
Error while installing iconv on windows by ruby2.0.0
I'm trying to install the iconv , but when I run the following command:
gem install iconv
my result:
Temporarily enhancing Path to include DevKit...
Building native extensions. This could take a while...
Error : Error installing iconv:
ERROR: Failed to build gem native extension.
C:/Ruby/Ruby200/bin/ruby.exe -r ./siteconf20150217-3212-i8hzmh.rb extconf.rb
checking for rb_enc_get() in ruby/encoding.h... yes
checking for rb_sys_fail_str() in ruby.h... yes
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... 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=C:/Ruby/Ruby200/bin/ruby
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/
--enable-config-charset
--disable-config-charset
--with-config-charset
--without-config-charset
--with-iconvlib
--without-iconvlib
extconf failed, exit code 1
please help me!!!!
THX.

I had this problem this evening (Windows 7, Ruby 1.9.3). The solution in my case was as follows:
Install the "Complete package, except sources" from http://gnuwin32.sourceforge.net/packages/libiconv.htm
Run gem install iconv -v '1.0.4' -- --with-iconv-dir=/path/to/GnuWin32
If that doesn't work, I also followed the instructions here first: http://donpepeto.com/2014/09/20/fixing-c-libraries-on-your-rubyrails-install-on-windows/ (Copying the contents of /bin, /include and /lib from the GnuWin32 install) They didn't work on their own, but once I'd run the setup, I was able to install the gem, so maybe that helped. I also got an error about a missing .gitignore, but I ignored that, ran gem install... again and it worked.

I was facing same issue on windows 10. Thanks #Emma Burrows and #ZeWaren. Following worked for me,
Install libiconv; http://gnuwin32.sourceforge.net/packages/libiconv.htm
Copy files from /include and /lib into /bin folder, for me C:\Program Files (x86)\GnuWin32\bin
Set PATH (Environment Variable) to C:\Program Files (x86)\GnuWin32\bin
Exceute (Tricky one): gem install iconv -- --with-iconv-dir="C:\Program Files (x86)\GnuWin32\" and during gem install quickly past files from /bin into C:\RailsInstaller\Ruby2.2.0\lib\ruby\gems\2.2.0\gems\iconv-1.0.4\ext\iconv

Related

Unable to install rmagick on mojave

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)

After upgrading to macOS Mojave gem update is failing

Building native extensions. This could take a while...
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/libxml-ruby-3.1.0/ext/libxml
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180926-80978-eoqfjh.rb extconf.rb
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... 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)
--with-xml2-config
--without-xml2-config
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
extconf failure: need libxml2.
Install the library or try one of the following options to extconf.rb:
--with-xml2-config=/path/to/xml2-config
--with-xml2-dir=/path/to/libxml2
--with-xml2-lib=/path/to/libxml2/lib
--with-xml2-include=/path/to/libxml2/include
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/libxml-ruby-3.1.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/libxml-ruby-3.1.0 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/libxml-ruby-3.1.0/gem_make.out
Updating nokogiri
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
The error is due to macOS Mojave has stopped placing the standard header files in /usr/include, keeping them only inside the XCode directory.
You can verify this by running ls /usr/include and most likely this directory does not exist anymore. On contrary, the usual trick by running xcode-select --install will not solve the problem.
The fix is to run legacy installer provided by Apple that will install the header files to /usr/include
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
If you are using homebrew, the recommended approach is to tell pkg-config where it can find the libxml2 library:
brew reinstall libxml2
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
Also, you may have outdated bundle config, which is in the way. Run bundle config build.nokogiri --use-system-libraries and it'll give you a warning and show what config you currently have. I was following all guides and reinstalled all gems and even ruby a few times only to find out that config was set to use a path that doesn't exist anymore.

Can't install OpenSSL gem on OSX

I'm trying to install the OpenSSL gem as follows:
sudo gem install openssl -- --with-openssl-dir=/usr/local/opt/openssl
However, I get the following error
Building native extensions with: '-with-openssl-dir=/usr/local/opt/openssl'
This could take a while...
ERROR: Error installing openssl:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/openssl-2.1.0/ext/openssl
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180501-55786-16tbndt.rb extconf.rb -with-openssl-dir=/usr/local/opt/openssl
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for openssl/ssl.h... 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)
--with-openssl-dir
--without-openssl-dir
--with-openssl-include
--without-openssl-include=${openssl-dir}/include
--with-openssl-lib
--without-openssl-lib=${openssl-dir}/lib
--with-kerberos-dir
--without-kerberos-dir
--with-kerberos-include
--without-kerberos-include=${kerberos-dir}/include
--with-kerberos-lib
--without-kerberos-lib=${kerberos-dir}/lib
--with-debug
--without-debug
--enable-debug
--disable-debug
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
extconf.rb:94:in `<main>': OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed. (RuntimeError)
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-17/2.3.0/openssl-2.1.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/openssl-2.1.0 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/openssl-2.1.0/gem_make.out
It says that it couldn't find OpenSSL. However, I specified it as a parameter, yet it is still not picking this up. Does anyone have any suggestions?
Notably, the error is:
OpenSSL library could not be found. You might want to use --with-openssl-dir= option to
specify the prefix where OpenSSL is installed.
Please, can you send the output of ls -l /usr/local/opt/openssl ?
Have you tried installing the latest version of openssl with brew: brew install openssl ?

Could not create Makefile for some reason - Trying to install Ruby Gem

I'm having some trouble installing a Ruby Gem called Lingust for my Mac. I get the error message below and have no idea how to solve the issue. Any help would be greatly appreciated.
gem install github-linguist
Building native extensions. This could take a while...
ERROR: Error installing github-linguist:
ERROR: Failed to build gem native extension.
/Users/kanery/.rvm/rubies/ruby-2.0.0-p643/bin/ruby -r./siteconf20151008-9054-b4exbs.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... no
ERROR: CMake is required to build Rugged.
*** 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/kanery/.rvm/rubies/ruby-2.0.0-p643/bin/ruby
--use-system-libraries
extconf failed, exit code 1
Gem files will remain installed in /Users/kanery/.rvm/gems/ruby-2.0.0-p643/gems/rugged-0.24.0b0 for inspection.
Reading the installation instructions of Rugged, you can see that both CMake and pkg-config are required. Looking at your error message, it seems like CMake is not installed on your system.
If you are using Homebrew, you can install it by running
brew install cmake
Or you can install it from the source following these instructions.

Installing Ruby Gem Not working on OSX 10.10 Yosemite

I am trying to install Github Linguist ruby gem through terminal in Mac .
I don't have enough points to upload image so please bear with me.
This is error it is showing when I install it in terminal :-
bash-3.2# gem install github-linguist
Building native extensions. This could take a while...
ERROR: Error installing github-linguist:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150321-444-15aw05d.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... no
ERROR: CMake is required to build Rugged.
* 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.0/usr/bin/ruby
--use-system-libraries
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/rugged-0.22.1b1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/rugged-0.22.1b1/gem_make.out
brew install cmake should do the trick
I know you are not asking how to manager Ruby's versions.
but starting to use RVM will help a lot.

Resources