make: execvp: gcc: Bad file number

849 views
Skip to first unread message

Sam Ruby

unread,
May 18, 2014, 1:12:31 AM5/18/14
to rubyin...@googlegroups.com
Note: I'm trying to install Rails, and therefore need to install the json gem.  In doing so, I'm getting the error mentioned in the subject line.


* Version of Windows

Fresh install of Windows 8.1 Build 20140402 as downloaded from http://modern.ie into a VirtualBox VM (host is this case is Ubuntu 14.04)

* Version of Ruby (ruby --version)

ruby 2.0.0p481 (2014-05-08) [i386-mingw32]

* Version of RubyGems (gem --version)

2.0.14

* Indicate that you have installed DevKit (according to the instructions) and which version (exact filename).

http://cdn.rubyinstaller.org/archives/devkits/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe

* Against which package (knapsack filename or any other obtained from the web) you're trying to link the gem.

I don't understand the question.

* Full command line executed that caused the error (gem install ...)

gem install json --platform=ruby

* Full output of the error. To copy from the console please see this article.

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 "DESTDIR="
generating generator-i386-mingw32.def
compiling generator.c
make: execvp: gcc: Bad file number
make: *** [generator.o] Error 127

* Contents of mkmf.log that are generated inside the target gem directory (use pastie or gist to host the contents)

No such file:

C:\Ruby200\lib\ruby\gems\2.0.0\gems>dir/s mkmf.log
 Volume in drive C has no label.
 Volume Serial Number is 92AC-B31E
File Not Found

- Sam Ruby

Luis Lavena

unread,
May 18, 2014, 12:04:36 PM5/18/14
to rubyin...@googlegroups.com
Hello Sam,

The error sounds weird, like it failed to spawn a child process, perhaps over a network drive?

I've just tested against the same VM and got this:

C:\Users\IEUser>ruby -v
ruby 2.0.0p481 (2014-05-08) [i386-mingw32]

C:\Users\IEUser>gem --version
2.0.14

C:\Users\IEUser>gem install json --platform=ruby
Fetching: json-1.8.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-1.8.1
Parsing documentation for json-1.8.1
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.so, skipping
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.so, skipping
Installing ri documentation for json-1.8.1
1 gem installed

Can you show us the entire output of "gem env"?

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.
For more options, visit https://groups.google.com/d/optout.



--
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

Sam Ruby

unread,
May 18, 2014, 1:04:26 PM5/18/14
to rubyin...@googlegroups.com
On Sunday, May 18, 2014 12:04:36 PM UTC-4, Luis Lavena wrote:
Hello Sam,

The error sounds weird, like it failed to spawn a child process, perhaps over a network drive?

Not as far as I know.
 
I've just tested against the same VM and got this:

C:\Users\IEUser>ruby -v
ruby 2.0.0p481 (2014-05-08) [i386-mingw32]

C:\Users\IEUser>gem --version
2.0.14

C:\Users\IEUser>gem install json --platform=ruby
Fetching: json-1.8.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-1.8.1
Parsing documentation for json-1.8.1
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.so, skipping
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.so, skipping
Installing ri documentation for json-1.8.1
1 gem installed

Cool!  Can you retrace your steps?  In particular, did you override the extraction path for the devkit?  That's the only option I can think of in the installation process.  I took the default, which ended up being: C:\Users\IEUser\AppData\Local\Microsoft\Windows\INetCache\IE\VIM90K98
 
Can you show us the entire output of "gem env"?

RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.14
  - RUBY VERSION: 2.0.0 (2014-05-08 patchlevel 481) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby200/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: C:/Ruby200/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby200/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby200/lib/ruby/gems/2.0.0
     - C:/Users/IEUser/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
 
Thank you.

Thank you!  If you can retrace your steps, I would appreciate it, as I can recreate this VM at will.

- Sam Ruby

 

Luis Lavena

unread,
May 18, 2014, 2:51:32 PM5/18/14
to rubyin...@googlegroups.com
Hello,

See responses inline

On Sun, May 18, 2014 at 2:04 PM, Sam Ruby <sa3...@gmail.com> wrote:
On Sunday, May 18, 2014 12:04:36 PM UTC-4, Luis Lavena wrote:
Hello Sam,

The error sounds weird, like it failed to spawn a child process, perhaps over a network drive?

Not as far as I know.
 
I've just tested against the same VM and got this:

C:\Users\IEUser>ruby -v
ruby 2.0.0p481 (2014-05-08) [i386-mingw32]

C:\Users\IEUser>gem --version
2.0.14

C:\Users\IEUser>gem install json --platform=ruby
Fetching: json-1.8.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-1.8.1
Parsing documentation for json-1.8.1
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.so, skipping
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.so, skipping
Installing ri documentation for json-1.8.1
1 gem installed

Cool!  Can you retrace your steps?  In particular, did you override the extraction path for the devkit?  That's the only option I can think of in the installation process.  I took the default, which ended up being: C:\Users\IEUser\AppData\Local\Microsoft\Windows\INetCache\IE\VIM90K98

I extracted DevKit into C:\Ruby200\DevKit

Thank you!  If you can retrace your steps, I would appreciate it, as I can recreate this VM at will.


Perhaps that is a symlink or something and not a regular directory which could be affecting GCC.

Please try extracting into C:\Ruby200\DevKit and see how it goes.

I'm going to try the default directory of extraction and see if can replicate the problem.

Cheers,
-- 

Sam Ruby

unread,
May 18, 2014, 5:56:34 PM5/18/14
to rubyin...@googlegroups.com
On Sunday, May 18, 2014 2:51:32 PM UTC-4, Luis Lavena wrote:

Please try extracting into C:\Ruby200\DevKit and see how it goes.

It worked!  Thanks.

For reference, here is what I did.

Download Ruby >= 1.9.3 from: http://rubyinstaller.org/downloads
  Run
  English
  Accept License
  Click "Add Ruby executables to your PATH"
  Install

Select the DevKit link associated with the version of ruby (32 vs 64 bit) you selected.
  Run
  Change path to C:\Ruby200\DevKit
  Start a command prompt with Ruby
  cd C:\Ruby200\DevKit
  ruby dk.rb init
  ruby dk.rb install
  gem install json --platform=ruby

At this point, a gem install rails gets an error in producing ri documentation for actionpack, but that isn't likely to be a problem for me.  For completeness, here is the message:

 Installing ri documentation for actionpack-4.1.1
ERROR:  While executing gem ... (Errno::EINVAL)
    Invalid argument - ./ActionDispatch/Routing/Mapper/Scoping/:

- Sam Ruby

Luis Lavena

unread,
May 18, 2014, 8:37:34 PM5/18/14
to rubyin...@googlegroups.com
Hello Sam,

On Sun, May 18, 2014 at 6:56 PM, Sam Ruby <sa3...@gmail.com> wrote:
On Sunday, May 18, 2014 2:51:32 PM UTC-4, Luis Lavena wrote:

Please try extracting into C:\Ruby200\DevKit and see how it goes.

It worked!  Thanks.


Happy to hear it worked.
 
For reference, here is what I did.

Download Ruby >= 1.9.3 from: http://rubyinstaller.org/downloads
  Run
  English
  Accept License
  Click "Add Ruby executables to your PATH"
  Install

Select the DevKit link associated with the version of ruby (32 vs 64 bit) you selected.
  Run
  Change path to C:\Ruby200\DevKit
  Start a command prompt with Ruby
  cd C:\Ruby200\DevKit
  ruby dk.rb init
  ruby dk.rb install
  gem install json --platform=ruby

At this point, a gem install rails gets an error in producing ri documentation for actionpack, but that isn't likely to be a problem for me.  For completeness, here is the message:

 Installing ri documentation for actionpack-4.1.1
ERROR:  While executing gem ... (Errno::EINVAL)
    Invalid argument - ./ActionDispatch/Routing/Mapper/Scoping/:


This is caused by an attempt of RDoc to generate documentation for ":", updating rdoc (gem update rdoc) should fix future gem installation.

Cheers,
-- 
Reply all
Reply to author
Forward
0 new messages