rubocop gem install gives ERROR: Failed to build native gem extension - ruby

I recently installed Ruby from http://railsinstaller.org/en.
This included Ruby on Rails and the Ruby dev-kit.
Now I am trying to install rubocop, but it isn't working:
C:\Windows\System32>gem install rubocop
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing rubocop:
ERROR: Failed to build gem native extension.
current directory: C:/_Programming/Ruby/Installation/RailsInstaller/Ruby2.3.
0/lib/ruby/gems/2.3.0/gems/rainbow-2.2.2/ext
C:/_Programming/Ruby/Installation/RailsInstaller/Ruby2.3.0/bin/ruby.exe mkrf_con
f.rb
rake failed, exit code 1
Gem files will remain installed in C:/_Programming/Ruby/Installation/RailsInstal
ler/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rainbow-2.2.2 for inspection.
Results logged to C:/_Programming/Ruby/Installation/RailsInstaller/Ruby2.3.0/lib
/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/rainbow-2.2.2/gem_make.out
C:\Windows\System32>echo %path%
C:\ProgramData\Oracle\Java\javapath;C:\_Programming\Install\Python27\;C:\_Progra
mming\Install\Python27\Scripts;C:\Program Files (x86)\Borland\Delphi7\Bin;C:\Pro
gram Files (x86)\Borland\Delphi7\Projects\Bpl\;C:\Program Files (x86)\Embarcader
o\Studio\16.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\16.0\Bpl;C:\Progr
am Files (x86)\Embarcadero\Studio\16.0\bin64;C:\Users\Public\Documents\Embarcade
ro\Studio\16.0\Bpl\Win64;C:\Ruby193\bin;C:\Windows\System32;C:\Program Files (x8
6)\Borland\Delphi5\Bin;Q:\;C:\Windows\System32\Windows System Resource Manager\b
in;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;
C:\Program Files (x86)\Extra!\;C:\HashiCorp\Vagrant\bin;C:\_Programming\Ruby\Ins
tallation\RailsInstaller\Ruby2.3.0\bin;C:\Windows\system32\16.0\Bpl;C:\Program F
iles\Git\cmd

Related

Cannot find ruby.h file in system

Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20200330-8267-hpu1jf.rb extconf.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18/rbconfig.rb:215: warning: Insecure world writable dir /Library/Ruby/Gems/2.3.0 in PATH, mode 040777
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.12.2/gem_make.out
I am trying to download CocoaPods and this error is generatedThe system wasn't able to find ruby.h file but when I digged a little deep, I found out that there is no folder like include in the location specified(/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h). I even tried to manually add the folder but the system didn't give me permission for that even when I used sudo command.

issue installing a gem

I've checked many other posts but I can't seem to find a solution, I get the same error each time I try to install this gem. I've tried reinstalling and even changing ruby versions (I tried my original 25 install then the latest 26 then 25), but nothing worked.
here's the log:
PS X:\Windows\system32> gem install solargraph
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing solargraph:
ERROR: Failed to build gem native extension.
current directory: X:/Program Files (x86)/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
"X:/Program Files (x86)/Ruby25-x64/bin/ruby.exe" -r ./siteconf20191204-11892-whysdy.rb extconf.rb
creating Makefile
current directory: X:/Program Files (x86)/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
make "DESTDIR=" clean
Makefile:267: *** multiple target patterns. Stop.
current directory: X:/Program Files (x86)/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
make "DESTDIR="
Makefile:267: *** multiple target patterns. Stop.
make failed, exit code 2
Gem files will remain installed in X:/Program Files (x86)/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jaro_winkler-1.5.4 for inspection.
Results logged to X:/Program Files (x86)/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/jaro_winkler-1.5.4/gem_make.out
Ruby was installed in Program Files (x86) which contains a space, which apparently MINGW gems, such as jaro_winkler, don't agree with, so if you encounter this issue change your Ruby install location.

'Pygments gem or one of its dependencies isn't installed' error message

I tried to install this starter project: https://github.com/shakyShane/jekyll-gulp-sass-browser-sync
I have the latest Ruby and Node.js installed. I followed the setup instructions for this starter project: installed jekyll, gulp, ran the npm install command and after that gulp. And when I ran gulp I got this error message:
Dependency Error: Yikes! It looks like you don't have pygments
or one of its dependencies installed. In order to use Jekyll as currently configured, you'll
need to install this gem. The full error message from Ruby is:
'cannot load such file -- pygments' If you run into trouble, you can find helpful resources
at http://jekyllrb.com/help/!
Liquid Exception: pygments in C:/work/Web/MySite/_posts/2014-04-20-welcome-to-jekyll.markdown
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
pygments
I tried to install pygments manually: gem install pygments.rb, but it didn't help.
I'm new to Ruby and Jekyll... What went wrong here and how can it be fixed?
UPDATE
This is the error message from gem install pygments.rb:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing pygments.rb:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160811-6768-1qhknd7.rb extconf.rb
creating Makefile
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR=" clean
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR="
generating yajl-x64-mingw32.def
compiling yajl.c
yajl.c: In function 'yajl_status_to_string':
yajl.c:61:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
...more of these yajl_... visibility attribute not supported messages...
c:/ruby23-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o: file not recognized: File trun
cated
collect2.exe: error: ld returned 1 exit status
make: *** [yajl.so] Error 1
make failed, exit code 2
Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/yajl-ruby-1.2.1/gem_make.out
OK, after a very long time I finally found a solution to the problem I had. Here's what I did:
Completely uninstalled all gems.
Uninstalled Ruby DevTools
Uninstalled Ruby
Re-installed Ruby
Re-installed Ruby DevTools (downloaded it again, apparently my previous download had corrupted files) , changed config.yml to include - C:/Ruby23-x64
Re-installed pygments.rb (this time it went well, without any errors)
Installed Python (very important)
Edited Gulp's _config.yml and changed default highlighter from pygments to rouge
Installed redcarpet gem gem install redcarpet
Ran gulp again and this time it finally worked as expected!

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.

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?

Resources