Ruby DevKit problems - ruby

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.

Related

iconv install failure ruby

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.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension(ffi gem) - windows

When I run bundle install, it fails when it try to install ffi gem with native extension. I get this error
Installing ffi 1.8.1 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
C:/Ruby21-x64/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile
make "DESTDIR="
generating ffi_c-x64-mingw32.def
Configuring libffi
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: WARNING: cache variable lt_cv_path_LD contains a newline
configure: WARNING: cache variable lt_cv_path_LD contains a newline
make -C "/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32"
make[1]: Entering directory `/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32'
Makefile:318: *** missing separator. Stop.
make[1]: Leaving directory `/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32'
make: *** ["/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32"/.libs/libffi_convenience.a] Error 2
Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1 for inspection.
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.8.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.8.1'` succeeds before bundling.
I am on windows 7 with ruby 2.1.7 and rails 3.2. I have found different solution like updating system gems and downgrading ffi version but none of them is working for me. How can I solve this problem?

Installing any gems in ruby will bring ERROR: failed to build gem native extension

I am using windows 8.1 with Ruby 1.9.3 - when I try to install any gems this error shows:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe -r ./siteconf20141011-6892-1pldhkg.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile
make clean
Makefile:165: *** target pattern contains no `%'. Stop.
make
Makefile:165: *** target pattern contains no `%'. Stop.
make failed, exit code 2
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.6
for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/ff
i-1.9.6/gem_make.out
I fixed this problem by reinstalling Ruby (1.9.3) and making sure to check the "Add Ruby executables to your PATH" checkbox during installation.
Source: the first section of this page https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting

Tiny_tds gem on Ruby 2.0.0 fails - libiconv missing on Windows x64

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

sudo gem install rmagick fails

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.

Resources