Re: "gem" command doesn't work (Ruby 2.0.0-p0 on XP). ERROR: Failed to build gem native extension ...

456 views
Skip to first unread message

A B

unread,
Mar 18, 2013, 3:49:54 AM3/18/13
to rubyin...@googlegroups.com
I've examined that in the code place where it shows the error - in generator.c:1:0: internal compiler error: Illegal instruction

There is such an instruction in that file on the 1st line:
#include "../fbuffer/fbuffer.h"

I've checked the same file and the same place in my working version of Ruby (by RailsInstaller 1.9.3p125).
There is just the same strange #include (I'm not very strong in C++ but in my C++ experience I have never put such a path in this directive, only filenames).
But anyway it works there and throws an error here, in RubyInstaller.
May it be the cause of problem?
Something wrong with compiler settings? version?


I've tried all possible thing mentioned here https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting. Didn't help.


понедельник, 18 марта 2013 г., 7:46:16 UTC+2 пользователь A B написал:
Hello.

I'm trying to install Ruby 2.0.0-p0 with RubyInstaller on Windows XP.

I've downloaded executable (rubyinstaller-2.0.0-p0.exe).
I've downloaded DevKit executable (DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe)

I've installed Ruby in C:\Ruby200
I've checked, Ruby works:
C:\>ruby -v
ruby 2.0.0p0 (2013-02-24) [i386-mingw32]
 
C:\>ruby -e "puts 'Hello World'"
Hello World 
 

Then I unpacked the DevKit in C:\DevKit
Then I did these steps:
C:\Documents and Settings\User>cd C:\DevKit
 
C:\DevKit>ruby dk.rb init
[INFO] found RubyInstaller v2.0.0 at C:/Ruby200
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

 C:\DevKit>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby200'
[INFO] Installing 'C:/Ruby200/lib/ruby/site_ruby/devkit.rb'

And now an error appears:

C:\DevKit>gem install json --platform=ruby
Fetching: json-1.7.7.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

    C:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile

make
generating generator-i386-mingw32.def
compiling generator.c
generator.c:1:0: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
make: *** [generator.o] Error 1


Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.7.7 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.7.7/ext/json/ext/generator/gem_make.out 


I have also installed:
Cygwin (C:\cygwin),
MinGW compilers (C:\MinGW\bin),
RailsInstaller with Ruby 1.9.3p125 (C:\RailsInstaller\Ruby1.9.3\bin).

None of these three is in my PATH. I removed all any links to their directories from my PATH before I started installation.

RailsInstaller's Ruby 1.9.3p125 works just fine. All the commands, everything. I develop Rails with it now.
Even now, after instillation of Ruby 2.0.0-p0, I can do this and it works:
C:\DevKit>C:\RailsInstaller\Ruby1.9.3\bin\ruby -v
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

C:\DevKit>C:\RailsInstaller\Ruby1.9.3\bin\gem query --remote --name-matches zen_config
*** REMOTE GEMS ***
zen_config (0.0.4) 
 
But Ruby 2.0.0-p0 doesn't work. I'd like to install Ruby 2.0.0-p0 with RubyInstaller and continue working with 2.0.0 version but smth goes wrong with installation. What may it be? How to solve it?

Thank you.

A B

unread,
Mar 18, 2013, 3:59:46 AM3/18/13
to rubyin...@googlegroups.com
Here's an output about DevKit's mingw versions:

C:\DevKit>C:\DevKit\mingw\bin\gcc --version
gcc (rubenvb-4.7.2-release) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\DevKit>C:\RailsInstaller\DevKit\mingw\bin\gcc --version
gcc (tdm-1) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



понедельник, 18 марта 2013 г., 9:49:54 UTC+2 пользователь A B написал:

Luis Lavena

unread,
Mar 18, 2013, 8:52:18 AM3/18/13
to rubyin...@googlegroups.com

What processor is your computer?

The GCC version used by ruby 2.0.0 is using Nocona, illegal instructions might raise from such optimization.

Sorry for top posting. Sent from mobile.

See <mingw-w6...@lists.sourceforge.net> for instructions.
make: *** [generator.o] Error 1


Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.7.7 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.7.7/ext/json/ext/generator/gem_make.out 


I have also installed:
Cygwin (C:\cygwin),
MinGW compilers (C:\MinGW\bin),
RailsInstaller with Ruby 1.9.3p125 (C:\RailsInstaller\Ruby1.9.3\bin).

None of these three is in my PATH. I removed all any links to their directories from my PATH before I started installation.

RailsInstaller's Ruby 1.9.3p125 works just fine. All the commands, everything. I develop Rails with it now.
Even now, after instillation of Ruby 2.0.0-p0, I can do this and it works:
C:\DevKit>C:\RailsInstaller\Ruby1.9.3\bin\ruby -v
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

C:\DevKit>C:\RailsInstaller\Ruby1.9.3\bin\gem query --remote --name-matches zen_config
*** REMOTE GEMS ***
zen_config (0.0.4) 
 
But Ruby 2.0.0-p0 doesn't work. I'd like to install Ruby 2.0.0-p0 with RubyInstaller and continue working with 2.0.0 version but smth goes wrong with installation. What may it be? How to solve it?

Thank you.

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyinstalle...@googlegroups.com.
To post to this group, send email to rubyin...@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyinstaller?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

A B

unread,
Mar 18, 2013, 12:32:00 PM3/18/13
to rubyin...@googlegroups.com
My processor:

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 10
model name      : AMD Athlon(tm) XP 2500+
stepping        : 0
cpu MHz         : 1833
cache size      : 512 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
TLB size        : 512 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 34 bits physical, 32 bits virtual
power management: ts


 I've written a simple C++ code with an #include directive of the same form I had an error with (from real code: #include "../fbuffer/fbuffer.h"). Just to see if I get any such kind of errors. My header was #include "./headers/hello.h".

And compiled that code with the MinGW compiler I had installed on my computer (it is gcc version 4.7.2 (GCC) from http://www.mingw.org/). And got no any errors. #include "./with/path" works fine in my MinGW, but throws an error with gcc version 4.7.2 (rubenvb-4.7.2-release) from DevKit.

Actually it seems that gem generally works fine. I've successfully updated it from default 2.0.0 to 2.0.3. Then I installed Configuration gem without any errors. And finally I checked "gem list --remote" command and got result. But with gem 2.0.0 I couldn't, it hung up terminal. 

But I still get the same error with json gem installation. It breaks down on that #include. Hope I'll be able to install Rails.



понедельник, 18 марта 2013 г., 14:52:18 UTC+2 пользователь Luis Lavena написал:

Luis Lavena

unread,
Mar 18, 2013, 12:39:39 PM3/18/13
to rubyin...@googlegroups.com
Hello,

Let's break down the problems.
So what you're saying:

- Simple C code that includes a header
- Compiles with GCC 4.7.2 from mingw.org just fine
- Fails to compile with GCC 4.7.2 from DevKit (which is rubenvb's
build from mingw-w64 project)

If that is the case, can you provide a gist with the exact C code and
header example? I would like to elevate this to mingw-w64 developers.

> Actually it seems that gem generally works fine. I've successfully updated
> it from default 2.0.0 to 2.0.3. Then I installed Configuration gem without
> any errors. And finally I checked "gem list --remote" command and got
> result. But with gem 2.0.0 I couldn't, it hung up terminal.
>

Gem installation failing with RubyGems 2.0.0 is a known issue it
seems. Upgrading to RubyGems 2.0.3 fix this.

> But I still get the same error with json gem installation. It breaks down on
> that #include. Hope I'll be able to install Rails.
>

Can you provide the exact output of the failure you're getting? but
just for this gem?

Thank you.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Hiroshi Shirosaki

unread,
Mar 18, 2013, 6:19:14 PM3/18/13
to rubyin...@googlegroups.com
On Tue, Mar 19, 2013 at 1:32 AM, A B <lond...@gmail.com> wrote:
> My processor:
>
> processor : 0
> vendor_id : AuthenticAMD
> cpu family : 6
> model : 10
> model name : AMD Athlon(tm) XP 2500+
> stepping : 0
> cpu MHz : 1833
> cache size : 512 KB
> fpu : yes
> fpu_exception : yes
> cpuid level : 1
> wp : yes
>
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
> cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
>

rubenvb-4.7.2-release uses `-march=nocona` as gcc build option. It
seems your cpu doesn't support SSE3. So does not work.

from gcc document:
nocona
Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX,
SSE, SSE2 and SSE3 instruction set support.


gcc from http://www.mingw.org/, or
http://sourceforge.net/projects/mingwbuilds/ would not use
-march=nocona.

You have to make your own DevKit using gcc without -march=nocona.

A B

unread,
Mar 19, 2013, 9:35:28 AM3/19/13
to rubyin...@googlegroups.com

Hello.


No, I didn't find some magic C solution. I just checked whether my MinGW compiler can compile a C code that has such an include:

#include “../path/to/header.h”

instead of usual

#include “header.h”


I did an absolutely separate C code from any RubyInstaller’s or Ruby’s code or their processes. Sorry for misunderstanding, that’s my poor English speaking skills.

I have repeated the whole process of installation on Windows 8 computer 64 bits (RubyInstaller and json gem installation). All goes like a swiss watch. Only XP (I have to works with now) throws an error. But now I understand the reason.

Thank you for your work, for solutions you create.



понедельник, 18 марта 2013 г., 18:39:39 UTC+2 пользователь Luis Lavena написал:
Reply all
Reply to author
Forward
0 new messages