2

I'm trying to set up and run the Extreme Startup coding dojo on my Windows machine.

When I reach the bundle install step, I get this error message:

$ bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing builder 3.2.2
Installing nokogiri 1.4.5 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    c:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150826-3512-ilnke5.rb extconf.rb
*** 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
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=c:/Ruby22-x64/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)

extconf failed, exit code 1

Gem files will remain installed in c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.4.5 for inspection.
Results logged to c:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/nokogiri-1.4.5/gem_make.out
An error occurred while installing nokogiri (1.4.5), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.4.5'` succeeds before bundling.

According to the documentation for Nokogiri, it just ought to work, and in a sense, it does, because if I issue the command gem install nokogiri, it does work, but installs nokogiri-1.6.6.2-x64-mingw32.

As I understand the error message from bundle install, it specifically wants version 1.4.5. At least, even with nokogiri-1.6.6.2-x64-mingw32 installed, bundle install still fails with the above error message.

This is likely to be a simple problem, but since I'm a novice ruby user, I could use some help.

I've already tried the suggestions from Error installing Nokogiri on bundle install but already installed, but none of them work.

Community
  • 1
  • 1
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
  • Is http://stackoverflow.com/q/30322935/123527 a possible solution? – Simone Carletti Aug 26 '15 at 10:31
  • @SimoneCarletti Thank you, but the `rake install_deps` step fails on my machine. That accepted answer has been edited to indicate that it doesn't work. – Mark Seemann Aug 26 '15 at 10:39
  • This particular version of Nokogiri is listed in `Gemfile.lock`. You can probably try to remove that file, run `bundle install` again and see if it works. – katafrakt Aug 26 '15 at 12:35
  • @katafrakt That seem to work! Add your comment as an answer, and I'll accept it as *the* answer :) Thank you. – Mark Seemann Aug 26 '15 at 13:08
  • 1
    Just a heads up, Nokogiri doesn't have binaries for Ruby 2.2.X yet. So, unless you checkout master and build it (recently enabled building on Windows) you'll have to downgrade to Ruby 2.1.X. Sorry I didn't get to this earlier =/ – Azolo Aug 29 '15 at 16:23

1 Answers1

2

This particular version of Nokogiri is listed in Gemfile.lock. You can remove that file, run bundle install again and see if it works.

This is more a workaround than a proper solution, but dependencies in Gemfile.lock are quite old so it would be a good thing to refresh them anyway.

katafrakt
  • 2,438
  • 15
  • 19
  • Thank you for your help! I do have a follow-up question, which it is obviously entirely voluntary to answer: http://stackoverflow.com/q/32228794/126014 – Mark Seemann Aug 26 '15 at 14:02