Forum: Ruby Error While Install Gem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Nabs K. (Guest)
on 2009-06-02 23:19
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?
Eric H. (Guest)
on 2009-06-03 02:06
(Received via mailing list)
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?
Nabs K. (Guest)
on 2009-06-03 02:52
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. (Guest)
on 2009-06-03 03:04
(Received via mailing list)
On Jun 2, 2009, at 15:52, Nabs K. wrote:
>>> extconf.rb:3:in ``': No such file or directory - uname -p
> 4. nokogiri 1.3.0 (ruby)
> 5. Skip this gem
> 6. 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?
Nabs K. (Guest)
on 2009-06-03 03:39
Eric H. wrote:
> On Jun 2, 2009, at 15:52, Nabs K. wrote:
>>>> extconf.rb:3:in ``': No such file or directory - uname -p
>> 4. nokogiri 1.3.0 (ruby)
>> 5. Skip this gem
>> 6. 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:
     - http://gems.rubyforge.org

C:\Documents and Settings\Nabs>
Nabs K. (Guest)
on 2009-06-03 03:41
Thanks. Updating Gems...

Will post result.

Nabs
Nabs K. (Guest)
on 2009-06-03 03:51
Yup, that solved it, thanks. What is weird is that the
one-click-installer puts such an old version of RubyGems.

Thanks,

Nabs
Eric H. (Guest)
on 2009-06-03 04:25
(Received via mailing list)
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.
This topic is locked and can not be replied to.