Error While Install Gem

I am trying to install Mechanize on a WinXP machine, and I am getting
this error:

ERROR: Failed to build gem native extension

ruby extconf.rb install mechanize
extconf.rb:3:in ``’: No such file or directory - uname -p
(Errno::ENOENT) from extconf.rb:3

Googling results only in solutions for linux distros… on linux the
problem is that the ruby development libraries are not installed, where
am I supposed to find these for Windows? On OS X i would have typed sudo
apt-get dev-1.8 or something, but what do I do on WinXP?

On Jun 2, 2009, at 12:21, Nabs K. wrote:

I am trying to install Mechanize on a WinXP machine, and I am getting
this error:

ERROR: Failed to build gem native extension

ruby extconf.rb install mechanize
extconf.rb:3:in ``’: No such file or directory - uname -p
(Errno::ENOENT) from extconf.rb:3

What was the full error?

Eric H. wrote:

On Jun 2, 2009, at 12:21, Nabs K. wrote:

I am trying to install Mechanize on a WinXP machine, and I am getting
this error:

ERROR: Failed to build gem native extension

ruby extconf.rb install mechanize
extconf.rb:3:in ``’: No such file or directory - uname -p
(Errno::ENOENT) from extconf.rb:3

What was the full error?

C:\Documents and Settings\Nabs>gem install mechanize
Install required dependency nokogiri? [Yn] y
Select which gem to install for your platform (i386-mswin32)

  1. nokogiri 1.3.0 (x86-mingw32)
  2. nokogiri 1.3.0 (x86-mswin32)
  3. nokogiri 1.3.0 (java)
  4. nokogiri 1.3.0 (ruby)
  5. Skip this gem
  6. Cancel installation

2
Install required dependency racc? [Yn] y
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install mechanize
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

Eric H. wrote:

On Jun 2, 2009, at 15:52, Nabs K. wrote:

extconf.rb:3:in ``': No such file or directory - uname -p

  1. nokogiri 1.3.0 (ruby)
  2. Skip this gem
  3. Cancel installation

2

I think this went away with RubyGems 0.9.5

Install required dependency racc? [Yn] y

As did this.

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 suspect that either your ruby or your RubyGems versions are too old
and you should upgrade. Currently RubyGems is at 1.3.4

What do:

ruby -v

and

gem env

say?

C:\Documents and Settings\Nabs>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:\Documents and Settings\Nabs>gem env
RubyGems Environment:

  • VERSION: 0.9.4 (0.9.4)
  • INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
  • GEM PATH:
    • c:/ruby/lib/ruby/gems/1.8
  • REMOTE SOURCES:

C:\Documents and Settings\Nabs>

Thanks. Updating Gems…

Will post result.

Nabs

On Jun 2, 2009, at 15:52, Nabs K. wrote:

extconf.rb:3:in ``’: No such file or directory - uname -p

  1. nokogiri 1.3.0 (ruby)
  2. Skip this gem
  3. Cancel installation

2

I think this went away with RubyGems 0.9.5

Install required dependency racc? [Yn] y

As did this.

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 suspect that either your ruby or your RubyGems versions are too old
and you should upgrade. Currently RubyGems is at 1.3.4

What do:

ruby -v

and

gem env

say?

Yup, that solved it, thanks. What is weird is that the
one-click-installer puts such an old version of RubyGems.

Thanks,

Nabs

On Jun 2, 2009, at 16:51, Nabs K. wrote:

On June 2, 2009 16:39, Nabs K. wrote:

C:\Documents and Settings\Nabs>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

Yup, that solved it, thanks. What is weird is that the
one-click-installer puts such an old version of RubyGems.

The latest one-click is newer than ruby 1.8.6p111, you either found an
old version or installed it a long time ago.