I've got huge headache trying to install iconv gem on ruby.
gem install iconv -- --http-proxy http://login:password.#proxy:8080 --with-iconv-dir=\D:\libiconv
Result is:
ERROR: Error installing iconv:
ERROR: Failed to build gem native extension.
current directory: D:/InstantRails/ruby/lib/ruby/gems/2.3.0/gems/iconv-1.0.4/ext/iconv D:/InstantRails/ruby/bin/ruby.exe -r ./siteconf20161020-2784-1sz8avf.rb extconf.rb --http-proxy http://bche:f1r305sty5.#proxy.isd.dp.ua:8080 --with-iconv-dir=D:/libiconv
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.
I've downloaded all source files that possible. Please help
Iconv has been deprecated since Ruby v 1.9.3, only old gems use it these days and you would better update or replace these.
If you use it yourself, the same functionality can be reached using String.encode or String.scrub (Ruby -v ~> 2.1).
I'm not saying it is impossible to install it but I question the effort you are gonna spend in it isn't better used elsewhere. Had the same problem installing Sqlite in Ruby 2.3.0 and succeeded only after trying multiple times and after a few weeks.
Related
I found this "Zlib missing" continously when installing gems for Rails on Ruby, please let me know a solution :
Fetching nokogiri 1.10.2
Installing nokogiri 1.10.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.2/ext/nokogiri
/usr/local/opt/ruby/bin/ruby -I /usr/local/Cellar/ruby/2.6.2/lib/ruby/2.6.0 -r ./siteconf20190407-34092-u44l37.rb extconf.rb
checking if the C compiler accepts -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for iconv.h... yes
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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.
I also re-installed OSX 10.14 SDK header but didn't work.
It turned out that I have to manually download zlib from its site and then install it myself to make it work.
Extract the package then install as instruction :
./Configure
make
make install
I am trying to install and use the Sablon ruby gem. I have installed xcode command line developer tools. However, I continue to get the following error:
ERROR: Error installing sablon:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 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.
Using mini_portile version 2.1.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
checking for iconv... yes
Any ideas as to what might be going on here?
try
gem install sablon -- --use-system-libraries=true
if it doesn't work may i ask how you installed xcode command line tools?
It looks like a frequent error, but after 2 days, I still did not find the definite solution to this issue.
I installed Ruby 2.0.0-p451 (x64) and DevKit (DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe) from RubyInstaller for Windows. Ruby -v returns:
ruby 2.0.0p451 (2014-02-24) [x64-mingw32]
Now, I run gem install tiny_tds, which returns:
E:\>gem install tiny_tds
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
E:/Ruby200/bin/ruby.exe extconf.rb
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv is missing.
-----
*** 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.
Actually, the only libiconv I have on my system is E:\Ruby200\bin\libiconv-2.dll
I tried all I could find around without success, but I'm sure there is a smart answer to this. Can you please help me find it ?
Thanks a lot,
Best regards,
Fred
I have some troubles with the DevKit installation. Basically, it's not working. I've installed it by the books but the installation fails the test:
gem install rdiscount --platform=ruby
returns the following error:
C:\Ruby 1.9.3-p327\DevKit>gem install rdiscount --platform=ruby
Building native extensions. This could take a while...
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
"C:/Ruby 1.9.3-p327/bin/ruby.exe" extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
creating Makefile
make
Makefile:219: *** multiple target patterns. Stop.
Gem files will remain installed in C:/Ruby 1.9.3-p327/lib/ruby/gems/1.9.1/gems/r
discount-1.6.8 for inspection.
Results logged to C:/Ruby 1.9.3-p327/lib/ruby/gems/1.9.1/gems/rdiscount-1.6.8/ex
t/gem_make.out
Also this is of no use. everything is fine there.
The gem_make.out contains this :
"C:/Ruby 1.9.3-p327/bin/ruby.exe" extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
creating Makefile
make
Makefile:219: *** multiple target patterns. Stop.
At this point I am going crazy. I try running just extconf.rb
C:\Ruby 1.9.3-p327\lib\ruby\gems\1.9.1\gems\rdiscount-1.6.8\ext>ruby extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
creating Makefile
No errors!
My OS is windows 7 x64! There are no other versions of Ruby or DevKit installed on the system and this is the PATH
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Ruby 1.9.3-p327\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\pik;C:\Ruby 1.9.3-p327\DevKit\bin;C:\Ruby 1.9.3-p327\DevKit\mingw\bin
I may be wrong but I think the Ruby installation path is being read as two different arguments, effectively "C:/Ruby" "1.9.3-p327/bin/ruby.exe" because the path has not been escaped (is that the right word? Wrapped in quotes basically).
I suggest you take a look at a similar question on Stack Overflow. I had exactly the same problem as you, and this solution solved it straight-away.
I am getting this error when I try to install RMagick on my machine so I can play with Scruffy graph creator:
sudo gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/richardjburton/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... 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.
Any help would be awesome! Thanks.
Looks like you installed ImageMagick using a binary distro or something else which didn't include the headers. From your /Users directory you're probably using OSX. Assuming so, install ImageMagick using either Macports or Homebrew.