3

I am trying to install a ruby gem. I am getting this error.

C:\>gem install racc
Building native extensions.  This could take a while...
ERROR:  Error installing racc:
        ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb install racc
extconf.rb:3:in ``': No such file or directory - uname -p (Errno::ENOENT)
        from extconf.rb:3


Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/racc-1.4.6 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/racc-1.4.6/ext/racc/cparse/gem_make.out

I have searched this site, but found nothing about it. I have googled too, and found only that updating ruby gems should solve the problem, but it did not.

I have ruby gems 1.2.0 and ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32], Windows 2003.

4
  • 1
    Is "uname -p" a valid command on your system? Commented Jul 16, 2009 at 10:13
  • No. Looks like that is unix command. en.wikipedia.org/wiki/Uname Commented Jul 16, 2009 at 10:57
  • I was thinking about how "uname -p" shows up in the error message and that perhaps it not being present on your system could have caused the error. Commented Jul 16, 2009 at 11:02
  • I understood your comment. :) It gave me an idea to install msys and cygwin to see if it will work then, but no luck. Commented Jul 16, 2009 at 13:02

2 Answers 2

4

This may not be directly related to this post but it helped me and i hope may help others who have had the "Failed to build gem native extension." error when installing gems on Windows.

The guys over at rubyinstaller.org provide a DevKit (http://rubyinstaller.org/download.html) containing GCC, Make and Sh for use when installing Gems. I followed the instructions for installing (http://wiki.github.com/oneclick/rubyinstaller/development-kit) and hey presto... gems that previously wouldn't install now install with no errors.

I've tested installing the RACC gem and had no problems (although i have no previous experience with this gem; maybe it has been fixed since.) I've also tested with RCOV (which i've never been able to get working correctly) and have managed to install it with no errors!

Hope this helps someone out there ;)

Sign up to request clarification or add additional context in comments.

Comments

2

The offending line in the extconf.rb file in the racc gem is this:

ENV["ARCHFLAGS"] = "-arch #{`uname -p` =~ /powerpc/ ? 'ppc' : 'i386'}"

Since you are not using a PowerPC (unless your setup is exceptionally unusual :) ), you can replace this line with:

ENV["ARCHFLAGS"] = "-arch i386"

I don't know if it will compile successfully now, but at least you'll be past this error.

3 Comments

Thanks. That fixed the error, but I get another one this time. :)
More info: Download racc-1.4.6.tgz from rubyforge.org/frs/?group_id=7299. Extract. Change ENV["ARCHFLAGS"] line in racc-1.4.6\ext\racc\cparse\extconf.rb. Open command prompt at racc-1.4.6 folder. Execute rake gem. in command prompt go to racc-1.4.6\pkg. Execute gem install racc.
The next error was that nmake is not installed. After I installed it, I got error that cl is not installed. I give up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.