Cannot install RCov from Gem - ruby

gem install rcov
Error:
Building native extensions. This could take a while...
ERROR: Error installing rcov:
ERROR: Failed to build gem native extension.
"C:/Program Files/Ruby191/bin/ruby.exe" extconf.rb
creating Makefile
make
Makefile:154: warning: overriding commands for target `C:/Program'
Makefile:148: warning: ignoring old commands for target `C:/Program'
make: *** No rule to make target `"/C/Program', needed by `callsite.o'. Stop.
Gem files will remain installed in C:/Program Files/Ruby191/lib/ruby/gems/1.9.1/gems/rcov-0.9.8 for inspection.
Results logged to C:/Program Files/Ruby191/lib/ruby/gems/1.9.1/gems/rcov-0.9.8/ext/rcovrt/gem_make.out
This output is now after installing DevKit - to the root Ruby folder.

Indeed, Gem is trying to compile the software for your OS (Windows, apparently).
If you are using the RubyInstaller (rather than the incomplete packages at http://ruby-lang.org), you should add the DevKit and you will get tools like make, gcc, etc. that will be able to compile many of the gems natively.
Otherwise, you should be able to use the Win32 binary version of the Rcov gem.
Sadly, the DevKit can't always compile every gem on Win32. But first, a question: did you follow Step 2 of the DevKit's installation instructions to edit the fstab file? If so, then the next best thing to do is email the RubyInstaller Google Group with details of the compilation problem.
I just tried the Win32 binary rcovrt.so from the Rcov site on my own Windows box, but it doesn't recognize as a valid Windows image, at least with my Ruby 1.9 installation... so figuring out how to make the DevKit compilation to work may be your best bet.

The gem you're trying to use needs to compile native extensions (code which is compiled per system), and for that, it's using a makefile. Have you tried installing make?

You are correct, it is using GNU make. One option is to install cygwin and install make (under the devel tree in cygwin setup).

Related

Guide to installing ta-lib on Windows for Ruby gem

I have tried for quite a while to install ta-lib so I can use some of the indicator functions for trading based on this github example. So far I have determined that I need to:
run gem install talib_ruby
C:\Users\king\Desktop\_REPOS\misc\stock_analysis\forex\oanda\ruby>gem install talib_ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing talib_ruby:
ERROR: Failed to build gem native extension.
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20160810-7176-j5lye2.rb extconf.rb
checking for TA_Initialize() in -lta_lib... no
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating talib-x64-mingw32.def
compiling talib.c
talib.c:2:32: fatal error: ta-lib/ta_abstract.h: No such file or directory
compilation terminated.
make: *** [talib.o] Error 1
make failed, exit code 2
....
Download ta-lib header files which are in the msvc from here
Tell the talib_ruby gem where the ta-lib files when installing. Based on this SO post the correct command should look something like: sudo env ARCHFLAGS="-arch x86_64" gem install talib_ruby -- --with-talib-include=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/include/ta-lib --with-talib-lib=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/lib
. The command specifies a path to a lib folder which is missing from the ta-lib I downloaded. Does anyone know how to fix this?
Windows?
Sorry for my english.
My system: Windows 7 SP1 x64, ruby 2.2.4p230
You have to install Ruby Development Kit to build the binary extensions.
Download and extract source, I used ta-lib-0.4.0-src.tar.gz.
Run msys.bat from Ruby DevKit or if you have installed mingw as part of RubyInstaller, run either mingw64.exe or ming32.exe. Navigate to ta-lib source files (in my case it is /d/dev/ta-lib) and build the library:
cd /d/dev/ta-lib
./configure
make
Because the path to C headers hardcoded in gem to #include <ta-lib/ta_abstract.h>, I just make a new directory ta-lib within d:\dev\ta-lib\include source folder and all copy header files here. (Files in d:\dev\ta-lib\include*.h are copied to d:\dev\ta-lib\include\ta-lib)
Install gem. Exit the msys or mingw terminal and run the following in your Windows cmd. Be sure to replace these paths with the correct path to your ta-lib source:
gem install talib_ruby -- --with-talib-include=d:/dev/ta-lib/include --with-talib-lib=d:/dev/ta-lib/src/.libs
Make sure to change paths to yours.

Error installing debug_inspector 0.0.2 Native Extensions?

Getting this error when trying to do a bundle install. Following the instructions to do a direct gem install fails as well. I have since wiped all ruby (and project code) from my machine including any ruby configuration and reinstalled ruby, devkit, and my project code. Still getting this. Not sure where to look next. Most searches turn up gem-specific solutions that don't seem to apply here. Let me know if I can provide more info. Thanks!
An error occurred while installing debug_inspector (0.0.2), and Bundler cannot
continue.
Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before
bundling.
C:\TFS\Grange Commercial SEQ\White\Specifications>gem install debug_inspector -v
'0.0.2'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
The system cannot find the path specified.
ERROR: Error installing debug_inspector:
ERROR: Failed to build gem native extension.
C:/devl/Ruby/Ruby192/bin/ruby.exe extconf.rb
Gem files will remain installed in C:/devl/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems
/debug_inspector-0.0.2 for inspection.
Results logged to C:/devl/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/debug_inspector-
0.0.2/ext/debug_inspector/gem_make.out
I know this question is very old. However, I see two problems with this right off.
Windows doesn't have the tools (by default, or using the ruby installer) to compile c dependencies for ruby. If you want to do it yourself, you might check out: http://rubylearning.com/blog/how-do-i-install-a-ruby-gem-with-native-extensions-on-windows/
The other problem is that this particular gem doesn't work with ruby < 2.0: https://github.com/banister/debug_inspector and your ruby version appears to be 1.9.1
I would check your Gemfile.lock to see which gems are requiring debug-inspector. If you can do without them, take them out, and your bundle will succeed. If you must have them, try running a linux VM and using it for your development. My personal suggestion would be Ubuntu: http://www.ubuntu.com/download/desktop and VirtualBox or VMWare Player. Virtual Box is FOSS, so if this is company work, you'll have to use it: https://www.virtualbox.org/ . VMWare Player is free for personal use, and I like how it works a little better: http://www.vmware.com/products/player
I got the same error, using Ruby 2.2.4 64bit, on windows 10 64.
In my case what caused the error was installing several ruby versions, one after the other- (to try and solve that error)
Eventually I solved it by running ruby dk.rb install --force (At first I did that without the force flag), as stated by this answer- Just make sure to use the correct ruby version- version that worked for me was ruby 2.1.7 32bit.

Failing to install Jekyll gem native extension on Windows with "multiple target patterns"

I'm trying to get Jekyll up and running on my Windows 7 machine, but installing the gem fails with a make exception. I'm basically following the instructions provided by Madhur Arhuja plus some "fixes" due to some seemingly wrong links. Here is what I did:
Downloaded and installed ruby 1.9.3 p448
Downloaded and extracted the RubyDevelopmentKit from the same page.
In my Git Bash from the directory where I installed the development kit I ran
ruby dk.rb init
ruby dk.rb install
gem install jekyll
The first two steps worked fine. I got some Info output, no errors. But the last step created this:
$ gem install jekyll
Fetching: liquid-2.5.1.gem (100%)
Fetching: fast-stemmer-1.0.2.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
"c:/Program Files/Ruby193/bin/ruby.exe" extconf.rb
creating Makefile
make
Makefile:222: *** multiple target patterns. Stop.
Gem files will remain installed in c:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2 for inspection.
Results logged to c:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/ext/gem_make.out
In Very simple application fails with "multiple target patterns" from Eclipse I found that this might be related to the unix emulator, so I ran the last command again in the windows shell, but with the same result.
Since I have no idea about ruby, c, make or anything involved I'm completely stuck :-(
Ok just a try. The Makefile on this line (and following) defines the target for .m.o.
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$# -c $<
Everything looks ok if you're using mingw / cygwin, but INCFLAGS can make problems on window machines, if you've installed ruby in a directory with spaces.
INCFLAG is defined as INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) and if you see my definition below there is no space in any path.
topdir = /C/Ruby200-x64/include/ruby-2.0.0
hdrdir = $(topdir)
arch_hdrdir = C:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32
If I change the ruby installation to a path with spaces I get invalid option error in native windows command line and in the mingw session. Maybe this is could help.

Issue installing caldecott, make inoperable command

I've been trying to install this for a few days now with no success. Looking for help, I've been through this site a half dozen times to try and resolve the issue but I'm not having any luck.
c:\Ruby193\DevKit>gem install caldecott --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing caldecott:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
make
'make' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/escape_ut
ils-0.3.2 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/escape_utils-0.3.2/ext/esc
ape_utils/gem_make.out
I've attempted to follow the instructions on this post
-Make Is Not Recognized as an internal or exernal command
By Doing this:
c:\Ruby193>set make=mingw32-make
I unfortunately still get:
c:\Ruby193>gem install caldecott --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing caldecott:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
mingw32-make
'mingw32-make' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/escape_ut
ils-0.3.2 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/escape_utils-0.3.2/ext/esc
ape_utils/gem_make.out
I've also done:
c:\Ruby193\DevKit>gem install eventmachine --pre
As discussed here.
-Error Installing Caldecott
HALP!!! What am I doing wrong?
Windows 7
Running CMD as Admin
Ruby v1.9.3
DevKit - installed, in Ruby Folder, and postinstall ran
Update:
I've attempted to create my own match.bat file in the c:/ruby193/devkit/mingw/bin that should forward the make command to mingw32-make, still successful but here is my code for the batch (match.bat) file.
#echo off
mingw32-make %*
As explained on this forum.
-make.bat
Still no luck, I'll likely continue to roll my face on the keyboard until I find a solution.
Can you try to install without platform arugment, simply this command
$ gem install caldecott
what error you get now?

Installing dm-types on Windows. (Win7 x64)

I am trying to install dm-types for DataMapper on my machine with
gem install dm-types
I've installed Ruby from RubyInstaller (1.9.3) and I also have the DevKit installed. (Aswell as some other gems like sinatra, haml, dm-core and bcrypt-ruby).
However, when I run "gem install dm-types", this happens.
C:\Users\Lev>gem install dm-types
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing dm-types:
ERROR: Failed to build gem native extension.
"C:/Program Files (x86)/Ruby/Ruby193/bin/ruby.exe" extconf.rb
creating Makefile
make
Makefile:172: warning: overriding commands for target `C:/Program'
Makefile:163: warning: ignoring old commands for target `C:/Program'
Makefile:172: warning: overriding commands for target `Files'
Makefile:163: warning: ignoring old commands for target `Files'
Makefile:215: *** multiple target patterns. Stop.
Gem files will remain installed in C:/Program Files (x86)/Ruby/Ruby193/lib/ruby/
gems/1.9.1/gems/json-1.6.5 for inspection.
Results logged to C:/Program Files (x86)/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/j
son-1.6.5/ext/json/ext/parser/gem_make.out
My google-fu revealed that there are/were some bcrypt dependencies that won't build on windows but bcrypt installed flawlessly. I also have nmake.exe in my system path.
So how can I get dm-types to work on Windows 7 x64?
Also, I have absolutely no objection to wiping my machine clean of all ruby-related things and starting again.
It looks the the spaces in the path for ruby are screwing up the makefile. Maybe try creating a symlink on Windows temporarily, like:
mklink /d c:\ruby "C:\Program Files (x86)\Ruby\Ruby193"
and then try installing. You can delete the symlink after installing.
C:\ruby\bin\gem install dm-types
What Mayro said was right on the money, the thing I had to look out for was that In addition to the user PATH the link to the DevKit was also in the System Variables PATH which had the link that was causing my problem.
Or set your PATH in environment variables to C:\Progra~2\Ruby\Ruby193\bin instead of C:\Program Files\Ruby\Ruby193\bin
Progra~1 should be Program Files, Progra~2 should be Program Files (x86)

Resources