I'm using Ruby 1.9.3 on Windows8-64bit. My Ruby installation is in C:\Ruby193 and the Devkit is in C:\DevKit
I followed the DevKit installation and it's a success.
Then the guide asks me to test it by running gem install json --platform=ruby which returns this error (looks similar as before having DevKit installed):
Note: This other question here told me to add the DevKit installation folder to Environment PATH, I did it but still got same error.
C:\Users\myname>gem install json --platform=ruby
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
make
generating generator-i386-mingw32.def
compiling generator.c
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1381:0,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:41:8: error: redefinition of 'struc
t timespec'
In file included from c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../.
./../../i686-w64-mingw32/include/process.h:12:0,
from c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:62,
from c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223,
from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw
32/include/sys/types.h:89:8: note: originally defined here
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1381:0,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:48:8: error: redefinition of 'struc
t timezone'
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:63:0,
from c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223,
from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw
32/include/time.h:260:8: note: originally defined here
make: *** [generator.o] Error 1
Any solution? Thanks
Sorry, I used the wrong DevKit.
For Ruby 1.9.3 and below, we should use DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe The mingw is for 2.0 and above.
It works great now.
Related
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!
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.
When I run gem install thin under Ruby 2.1.7 (ruby 2.1.7p400 (2015-08-18 revision 51632) [i386-mingw32]), I get following errors.
D:\dev\myapp>gem install thin
Building native extensions. This could take a while...
ERROR: Error installing thin:
ERROR: Failed to build gem native extension.
C:/Ruby21/bin/ruby.exe extconf.rb
[...]
compiling cmain.cpp
cmain.cpp: In function 'int evma_send_file_data_to_connection(uintptr_t, const c
har*)':
cmain.cpp:802:20: error: 'fstat' was not declared in this scope
if (fstat (Fd, &st)) {
^
make: *** [cmain.o] Error 1
make failed, exit code 2
How can I work around this error?
Full log is available here.
I believe this was a known bug in earlier versions of the ruby devkit. Unfortunately I cannot find a reference to the fix.
Install the latest devkit and try again, this should solve your problem.
I am trying to installing ORI8 gems on JRuby 1.7.13 on Windows.
I am getting an error that states:
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8-2.1.7.gem:
ERROR: Failed to build gem native extension.
Use RbConfig instead of obsolete and deprecated Config.
mkmf.rb can't find header files for ruby at PATH_OF_JRUBY_installation/lib/native/include/ruby/ruby.h
I have checked in the PATH_OF_JRUBY_installation/lib folder and there is no native folder and sub folders.
How can I resolve the above problem?
I'm trying to install the curb gem on windows 7 with libcurl but it returns errors. This is for the eventual purpose of running a ruby app on a vm with vagrant, explained here github catarse install. but it returns an error saying:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe: invalid option -V (-h will show valid
options) (RuntimeError)
these are the versions I have used:
C:\>ruby -v
ruby 1.9.3p392 (2013-02-22) [i386-mingw32]
C:\>gem -v
2.0.3
C:\>vagrant -v
Vagrant version 1.2.2
So I've tried using http://beginrescue.blogspot.com.au/2010/07/installing-curb-with-ruby-191-in.html but there was an error and the make_gem.out file has a lot of these (as an example, I didnt think it necessary to post the whole file):
top:
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb --with-curl-lib=C:\curl-7.30.0-devel-mingw32\bin --with-curl-include=C:\curl-7.30.0-devel-mingw32\include
checking for curl-config... no
checking for main() in -lcurl... yes
checking for curl/curl.h... yes
bottom:
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:454: undefined reference to `_imp__curl_free'
curb_postfield.o: In function `append_to_form':
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:76: undefined reference to `_imp__curl_formadd'
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:115: undefined reference to `_imp__curl_formadd'
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:120: undefined reference to `_imp__curl_formadd'
collect2: ld returned 1 exit status
make: *** [curb_core.so] Error 1
I was getting the same lot of linker errors trying to install curb against the latest (at the time of this post) libcurl 7.32.0. Unfortunately, older versions that used to work for me before (e.g. 7.19.4) no longer include x86-mingw packages with the library and headers.
Here you can find a list of packages including libcurl 7.24.0 that can help you build the extensions. The first post also explains how to extract them and set up the environment. I was then able to install curb 0.8.5 with gem install curb -- --with-opt-dir=c:/path/to/libcurl.
I finally got curb to install by using the source for curl, curl-7.36.0.zip, after having to compile the DevKit, DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe with Ruby200 on windows 7 32bit. curl-7.36.0-win32-fix1.msi with curl-7.36.0-win32-fix1.zip didn't work, nor the older curl-7.34.0-devel-mingw32.zip.
It has been a harrowing experience, googling the problems to have answers given by individuals that don't connect to closed issues, etc.
My stack: Windows 7, git bash 1.8.4.msysgit, ruby 1.9.3p484, rubygems 1.8.28
I got it to work doing the following (mostly mentioned at http://beginrescue.blogspot.com.au/2010/07/installing-curb-with-ruby-191-in.html)
Install DevKit
Download and extract curl-7.34.0-devel-mingw32.zip to C: drive, let's called this location CURL7_HOME.
Add curl bin to the top of my PATH (something I missed the first time)
Install curb: gem install curb -- --with-curl-lib=$CURL7_HOME/bin --with-curl-include=$CURL7_HOME/include
Note: --with-curl-lib=$CURL7_HOME/bin is not a typo. Setting it to bin directory makes it work. I've tried --with-curl-dir=$CURL7_HOME and --with-curl-lib=$CURL7_HOME/lib and those don't work.