Annoying problem: gems tries to build native extension

Discussion in 'Ruby' started by marcel.luethi@mlsystems.ch, Sep 16, 2008.

  1. Guest

    Hi All,

    I have an annoying problem using gems.
    Yesterday I wanted to update all my gems to their latest version.
    For hpricot unfortunately I answered the question "Select which gem to
    install for your platform (i386-mswin32)" with "1" -> hpricot-0.6.16
    (ruby)
    I knew immediately this was wrong...
    It tried to build the native extension but I don't have any VC
    compiler installed therefore it stopped updating the gems.

    I cleaned hpricot-0.6.161 from gems\1.8\cache\, gems\1.8\specifications
    \ & gems\1.8\gems\
    That didn't help, still the same:

    C:\ruby>gem update
    Updating installed gems
    Updating hpricot
    Building native extensions. This could take a while...
    ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

    c:/ruby/bin/ruby.exe extconf.rb update
    checking for stdio.h... no
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers. Check the mkmf.log file for more
    details. You may need configuration options.

    Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --srcdir=.
    --curdir
    --ruby=c:/ruby/bin/ruby


    Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/
    hpricot-0.6.16
    1 for inspection.
    Results logged to c:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.161/ext/
    fast_xs/gem_make.out


    Because it installed not correctly "gem list --local" shows "hpricot
    (0.6)" and therefore uninstalling doesn't work:

    C:\ruby>gem uninstall hpricot -v '0.6.161'
    ERROR: While executing gem ... (Gem::InstallError)
    Unknown gem hpricot = 0.6.161


    I uninstalled Ruby totally and reinstalled it from scratch - but the
    problem is still the same!
    Here is my environment:

    C:\ruby>gem environment
    RubyGems Environment:
    - RUBYGEMS VERSION: 1.2.0
    - RUBY VERSION: 1.8.7 (2008-05-31 patchlevel 0) [i386-mswin32]
    - INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
    - RUBY EXECUTABLE: c:/ruby/bin/ruby.exe
    - EXECUTABLE DIRECTORY: c:/ruby/bin
    - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mswin32-60
    - GEM PATHS:
    - c:/ruby/lib/ruby/gems/1.8
    - GEM CONFIGURATION:
    - :update_sources => true
    - :verbose => true
    - :benchmark => false
    - :backtrace => false
    - :bulk_threshold => 1000
    - REMOTE SOURCES:
    - http://gems.rubyforge.org/


    Does anybody know why it still tries to install this hpricot-0.6.161
    (ruby)?
    Is there somewhere a cache (outside of the Ruby dir) from which it is
    loaded?
    Any help is highly appreciated!

    Thanks!

    Marcel
     
    , Sep 16, 2008
    #1
    1. Advertisements

  2. Damjan Rems Guest

    wrote:
    > Hi All,
    >
    > I have an annoying problem using gems.



    I too have problem which is probably related. When installing
    sqlite3-ruby:
    -------------------------
    C:\gem install sqlite3-ruby --no-rdoc --no-ri
    Building native extensions. This could take a while...
    ERROR: Error installing sqlite3-ruby:
    ERROR: Failed to build gem native extension.

    d:/ruby_186_287/bin/ruby.exe extconf.rb install sqlite3-ruby --no-rdoc
    --no-ri
    checking for fdatasync() in rt.lib... no
    checking for sqlite3.h... no

    nmake
    'nmake' is not recognized as an internal or external command,
    operable program or batch file.

    Gem files will remain installed in
    d:/ruby_186_287/lib/ruby/gems/1.8/gems/sqlite
    3-ruby-1.2.4 for inspection.
    Results logged to
    d:/ruby_186_287/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/
    sqlite3_api/gem_make.out
    ---------------------------

    I think nmake should't be used on windows platform since compiler is
    usually not present and gems are precompiled.


    However:
    ---------------------------
    c:\gem install --version 1.2.3 sqlite3-ruby --no-rdoc --no-ri
    Successfully installed sqlite3-ruby-1.2.3-x86-mswin32
    1 gem installed
    ---------------------------

    RubyGems is 1.2.0 fresh install from One-Click Ruby Installer 186-27
    RC1. OS is Windows 2003 R2 SP2.


    by
    TheR
    --
    Posted via http://www.ruby-forum.com/.
     
    Damjan Rems, Sep 16, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ruben
    Replies:
    5
    Views:
    281
    David Ross
    Aug 18, 2004
  2. Thaddeus L Olczyk

    Problem getting gems/listing gems. EINVAL

    Thaddeus L Olczyk, Aug 15, 2006, in forum: Ruby
    Replies:
    0
    Views:
    309
    Thaddeus L Olczyk
    Aug 15, 2006
  3. Edouard Dantes
    Replies:
    12
    Views:
    515
    Mike Dalessio
    Jan 31, 2011
  4. Ben Bb
    Replies:
    2
    Views:
    300
    Ben Bb
    Feb 9, 2009
  5. kungfu-free
    Replies:
    0
    Views:
    617
    kungfu-free
    Feb 9, 2009
  6. Nikita Vasilyev

    Can't install gems with native extensions

    Nikita Vasilyev, Mar 11, 2010, in forum: Ruby
    Replies:
    4
    Views:
    242
    Matt W.
    Apr 20, 2010
  7. mengjiang Liu

    Failed to build the native extension

    mengjiang Liu, May 6, 2010, in forum: Ruby
    Replies:
    1
    Views:
    468
    Luis Lavena
    May 6, 2010
  8. Deepak Kannan

    upgrading gems with native dependencies

    Deepak Kannan, Aug 3, 2010, in forum: Ruby
    Replies:
    2
    Views:
    143
    Roger Pack
    Aug 11, 2010
Loading...