Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support Ruby x64 on Windows #864

Closed
davispuh opened this Issue · 108 comments
@davispuh

With Ruby 2.0 release there's now Ruby x64 available for Windows. Also DevKit have been released with MinGW x64. Most of typical gems does build fine with it.
http://rubyinstaller.org/downloads/

@sroller

Let us know what we can do. Happy to help with x64-mingw32. Here's my environment:

[C:\Users\steffenr]gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.3
  - RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x64-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x64-mingw32
  - GEM PATHS:
     - C:/Ruby/lib/ruby/gems/2.0.0
     - C:/Users/steffenr/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-rdoc --no-ri"
  - REMOTE SOURCES:
     - https://rubygems.org/
@fbehrens

make gem install nokogiri --pre working on the x64-mingw32 platform using devkit (see announcement RubyInstaller 2.0.0).
That would be very nice :relaxed:

C:\ruby\DevKit-mingw64-64-4.7.2-20130224-1432-sfx> gem ins nokogiri --pre
Fetching: nokogiri-1.5.7.rc3.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

    c:/ruby/ruby-2.0.0-p0-x64-mingw32/bin/ruby.exe extconf.rb
Das System kann den angegebenen Pfad nicht finden.
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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:/ruby/ruby-2.0.0-p0-x64-mingw32/bin/ruby
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-iconv-dir
        --without-iconv-dir
        --with-iconv-include
        --without-iconv-include=${iconv-dir}/include
        --with-iconv-lib
        --without-iconv-lib=${iconv-dir}/lib
        --with-xml2-dir
        --without-xml2-dir
        --with-xml2-include
        --without-xml2-include=${xml2-dir}/include
        --with-xml2-lib
        --without-xml2-lib=${xml2-dir}/lib
        --with-xslt-dir
        --without-xslt-dir
        --with-xslt-include
        --without-xslt-include=${xslt-dir}/include
        --with-xslt-lib
        --without-xslt-lib=${xslt-dir}/lib
        --with-libxslt-config
        --without-libxslt-config
        --with-pkg-config
        --without-pkg-config
        --with-libxml-2.0-config
        --without-libxml-2.0-config
        --with-pkg-config
        --without-pkg-config
        --with-libiconv-config
        --without-libiconv-config
        --with-pkg-config
        --without-pkg-config


Gem files will remain installed in c:/ruby/ruby-2.0.0-p0-x64-mingw32/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.7.rc3 for inspection.
Results logged to c:/ruby/ruby-2.0.0-p0-x64-mingw32/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.7.rc3/ext/nokogiri/gem_make.out

C:\ruby\DevKit-mingw64-64-4.7.2-20130224-1432-sfx> gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.2
  - RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x64-mingw32]
  - INSTALLATION DIRECTORY: c:/ruby/ruby-2.0.0-p0-x64-mingw32/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: c:/ruby/ruby-2.0.0-p0-x64-mingw32/bin/ruby.exe
  - EXECUTABLE DIRECTORY: c:/ruby/ruby-2.0.0-p0-x64-mingw32/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x64-mingw32
  - GEM PATHS:
     - c:/ruby/ruby-2.0.0-p0-x64-mingw32/lib/ruby/gems/2.0.0
     - c:/home/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org/
@stibra

Hi,

Are there any news for x64-bit support? :(

Ruby 2.0 64-bit is primary version to run Ruby on Windows Server. I do not understand why somone would like to use 32-bit version of Ruby 2.0 when 64-bit is available.

Thanks,

Ratko

@flavorjones
Owner

@stibra Thank you for asking. This will be done as soon as I can get to it. Windows builds are hard to do, since libxml2, libxslt, libiconv and zlib must be pre-compiled and delivered as DLLs. Additionally, Team Nokogiri has no windows machines to test with.

I'm hoping to do this this week. Please be patient.

@sroller

I'm happy to help testing.

@stibra

Thanks for the information! I can provide Windows Servers for testing and will do the testing as soon you have something :)
We are running Ruby on Rails applications on Windows Server 2008 R2 and 2012 on IIS, using Helicon Zoo module for IIS.
HeliconTech is little bit slow with supporting Ruby 2.0, specially x64 version, but it works with manual configuration.

@flavorjones flavorjones referenced this issue in rake-compiler/rake-compiler
Merged

Add support for cross builds for multiple target platforms. #74

@zhon

Nokogiri depends on JSON 1.6.1 which doesn't compile while JSON 1.7.7 does.

@flavorjones
Owner

@zhon - I don't understand your comment.

@zhon

@flavorjones When I try installing nokogiri on Widown 64 (devkit.64-4.7.2), one of the problems I encounter is nokogiri attempting to install JSON 1.6.1 (which didn't compile).

@mrigeshpriyadarshi

Hey, am getting following error while installing aws-sdk gem on windows 7 64-bit:-

<<< ----
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9/test/namespaces/test_namespaces_in_parsed_doc.rb
Building native extensions. This could take a while...
C:/Ruby200-x64/bin/ruby.exe extconf.rb
"The system cannot find the path specified.

checking for libxml/parser.h... no

libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies."

*** 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.

----- >>>>

Following are the entries in mknf.log :-

<<< ---
In file included from C:/Ruby200-x64/include/ruby-2.0.0/libxml/parser.h:807:0,
from conftest.c:5:
C:/Ruby200-x64/include/ruby-2.0.0/libxml/encoding.h:28:19: fatal error: iconv.h: No such file or directory
compilation terminated.
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
5: #include
/
end */
----- >>>

I tried to download separate libxml2 and "libiconv-1.13.1-1-mingw32-dev" and put on the LIBDIR and INCLUDEDIR.

But still getting same error.

Environment Info :-

<<< ---
C:\DevKit>gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 2.0.3
  • RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x64-mingw32]
  • INSTALLATION DIRECTORY: C:/Ruby200-x64/lib/ruby/gems/2.0.0
  • RUBY EXECUTABLE: C:/Ruby200-x64/bin/ruby.exe
  • EXECUTABLE DIRECTORY: C:/Ruby200-x64/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x64-mingw32
  • GEM PATHS:
    • C:/Ruby200-x64/lib/ruby/gems/2.0.0
    • F:/.gem/ruby/2.0.0
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

C:\DevKit>

------ >>>>

Please guide.

@flavorjones
Owner

Hello, Windows users who are new to this thread!

Ruby 2.0 64-bit windows support is not yet available. Compilation at gem install time is not supported so please do not try. If you try, do not try to get us to help you do it. Adding your compilation errors to this ticket is simply adding noise.

The only supported method of installing Nokogiri for Windows is now, and will continue to be, having Team Nokogiri cross-compile the required DLLs for your platform, and shipping a "fat binary" gem.

@fbehrens

Thanks for clarification.
@mrigeshpriyadarshi use 32 bit ruby 2.0 on 64bit-windows, until its available. That's working fine

@mrigeshpriyadarshi

@fbehrens Thanks a lot.. I had 32 installation just wanted to move to 64-bit. :)
@flavorjones Thanks a lot for clarification...

@davispuh

any idea when we could expect it released? like after 2 weeks, month, etc?

@flavorjones
Owner

"So much time and so little to do. Wait a minute. Strike that. Reverse it. Thank you."

I'll let you know when I know. Historically speaking, windows users have not been active participants in the development process of Nokogiri, so it's great to see people anxious for updates.

@jphastings

I'd like to see this too, I can help with testing if it's needed!

@kostler

I'm interested in the windows 64 bit solution too and will grab it for testing as soon as it is available.

@phrozen

How is this going? I can test as much as you like! We're eager cause this is the first release of 64 bit Ruby for Windows.

@flavorjones
Owner

Hello everyone,

I will summarize previous updates for those who are new to the conversation: rake-compiler does not yet support the x64-mingw32 platform. Status on that is here: rake-compiler/rake-compiler#74

In the meantime, please keep in mind that compilation at gem install time is not supported so please do not try. If you try, do not try to get us to help you do it. Adding your compilation errors to this ticket is simply adding noise.

The only supported method of installing Nokogiri for Windows is now, and will continue to be, having Team Nokogiri cross-compile the required DLLs for your platform, and shipping a "fat binary" gem.

@davispuh

thanks for showing where's roadblock :)

@helgeho

I am getting the "libxml2 is missing" error even with x86-mingw32 on a windows 8 x64 machine.
My gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.0
  - RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby200/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: C:/Ruby200/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby200/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby200/lib/ruby/gems/2.0.0
     - C:/Users/Helge/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

gem install nokogiri ends with:

ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

    C:/Ruby200/bin/ruby.exe extconf.rb
The system cannot find the path specified.
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***

Any solutions for that problem?

@dimitko

If the real blocker is a lack of Win XP/7 x64 development machine where the cross compilation can happen, please shout. Many people, including me, are willing to provide you that. If you have all the necessary files in an archive (plus instructions), please provide that and I am sure the community can help.

If the real blocker however is that your own efforts of successfully compiling Nokogiri (and its dependecies) on a Windows box which you already have a hold of, are still in progress, well, then there isn't much we can do except wait.

Maybe I can explain a bit as to why the Win64 demand is rising.

I am working on several projects and am using multiple VirtualBox Linux guests to do so. However, for my host OS I prefer Win7 to any Linux simply because I am occasionally gaming (I am not sure Windows has any other valid use anyway, to be fair). And when I want to fiddle with something mine, I am not inclined to fire a virtual machine every time. I just wanna open my emacs and 1-2 consoles and start doing stuff. And here comes our problem -- having the "mandatory" gems (I consider Nokogiri one of them) on your system whenever you need them, which includes compiling the native ones (or having a "fat gem" as you put it) without too much trouble.

I believe there's a good number of devs on my page, so maybe that use-case can explain the demand.

In any case, please shout if you need some community support.

@johnnyshields

@dimitko I agree. Also don't forget that many users may be in an enterprise environment where they are forced to run Windows, despite their personal preferences for OSX or Linux.

@zhon

@dimitko I agree. Nokogiri has become core to Ruby. With many of the Windows' Ruby programmers using Win7 64 bit, we are stuck using Ruby 1.9.3 for projects that use Nokogiri.

We are used to compiling and installing other libraries (ex., libxml, curl) into our mingw system.

@phrozen

@zhon Although you are not stuck using 1.9.3, Nokogiri does install and run fine on Windows Ruby 2.0.0 x86, so as long as you do not go for 64 bits its fine.

Luis Lavena did circumvent the compile problems for Sqlite3 on Win x64 Ruby 2.0.0, I have seen him discussing some solutions for this too. Hope it gets fixed soon.

@flavorjones
Owner

Hello everyone,

I will summarize previous updates for those who are new to the conversation: rake-compiler does not yet support the x64-mingw32 platform. Status on that is here: rake-compiler/rake-compiler#74

In the meantime, please keep in mind that compilation at gem install time is not supported so please do not try. If you try, do not try to get us to help you do it. Adding your compilation errors to this ticket is simply adding noise.

The only supported method of installing Nokogiri for Windows is now, and will continue to be, having Team Nokogiri cross-compile the required DLLs for your platform, and shipping a "fat binary" gem.

@doobiwan

I just like to say thank you for the effort, it's much appreciated. :)

@lolmaus

Support for Windows x64 has been merged into Rake-compiler.

What does this mean for Nokogiri?

@luislavena
Owner

@lolmaus it means that when I release the new rake-compiler version, @flavorjones will be able to release an updated gem.

I'm finishing up setting up a Vagrant box that ruby developers will be able to use to cross-compile gems with fat binaries for 1.8.7, 1.9.3 and 2.0.0, also 64bits 2.0.0

I just need to wrap rake-compiler release notes and will resume work on the vagrant box (then repackage and upload somewhere)

@zhon

@luislavena, we really do appreciate all the hard work you do for us windows ruby folk.

@johnnyshields

@luislavena @flavorjones thank you for your hard work. Eagerly awaiting this! :+1:

@johnnyshields

@luislavena looks like Rake Compiler has been in pre-release state for a month or so. Please release when bandwidth allows since Nokogiri binaries look to be the last blocker for many Windows Rubyists to upgrade to 2.0.0.

@woainvzu

Hi, I'v met the same problem. Is there any method? Thanks.

GEM Environment

c:\MyProgrames\DevKit>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.3
  - RUBY VERSION: 2.0.0 (2013-05-14 patchlevel 195) [x64-mingw32]
  - INSTALLATION DIRECTORY: C:/MyProgrames/Ruby200-x64/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: C:/MyProgrames/Ruby200-x64/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/MyProgrames/Ruby200-x64/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x64-mingw32
  - GEM PATHS:
     - C:/MyProgrames/Ruby200-x64/lib/ruby/gems/2.0.0
     - C:/Users/jiaoolii/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/

gem install nokogiri

c:\MyProgrames\DevKit>gem install nokogiri
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

    C:/MyProgrames/Ruby200-x64/bin/ruby.exe extconf.rb
The system cannot find the path specified.
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing depend
encies.
-----
*** 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:/MyProgrames/Ruby200-x64/bin/ruby
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-iconv-dir
        --without-iconv-dir
        --with-iconv-include
        --without-iconv-include=${iconv-dir}/include
        --with-iconv-lib
        --without-iconv-lib=${iconv-dir}/lib
        --with-xml2-dir
        --without-xml2-dir
        --with-xml2-include
        --without-xml2-include=${xml2-dir}/include
        --with-xml2-lib
        --without-xml2-lib=${xml2-dir}/lib
        --with-xslt-dir
        --without-xslt-dir
        --with-xslt-include
        --without-xslt-include=${xslt-dir}/include
        --with-xslt-lib
        --without-xslt-lib=${xslt-dir}/lib
        --with-libxslt-config
        --without-libxslt-config
        --with-pkg-config
        --without-pkg-config
        --with-libxml-2.0-config
        --without-libxml-2.0-config
        --with-pkg-config
        --without-pkg-config
        --with-libiconv-config
        --without-libiconv-config
        --with-pkg-config
        --without-pkg-config


Gem files will remain installed in C:/MyProgrames/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9 for inspection.
Results logged to C:/MyProgrames/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9/ext/nokogiri/gem_make.out

gem install libxml-ruby

c:\MyProgrames\DevKit>gem install libxml-ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing libxml-ruby:
        ERROR: Failed to build gem native extension.

    C:/MyProgrames/Ruby200-x64/bin/ruby.exe extconf.rb
extconf.rb:17:in `': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:17:in `': Use RbConfig instead of obsolete and deprecated Config.
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... yes
checking for inflate() in -lz... no
checking for inflate() in -lzlib... no
checking for inflate() in -lzlib1... no
checking for inflate() in -llibz... 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
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/MyProgrames/Ruby200-x64/bin/ruby
        --with-iconv-dir
        --without-iconv-dir
        --with-iconv-include
        --without-iconv-include=${iconv-dir}/include
        --with-iconv-lib
        --without-iconv-lib=${iconv-dir}/
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/
        --with-socketlib
        --without-socketlib
        --with-nsllib
        --without-nsllib
        --with-mlib
        --without-mlib
        --with-zlib
        --without-zlib
        --with-zliblib
        --without-zliblib
        --with-zlib1lib
        --without-zlib1lib
        --with-libzlib
        --without-libzlib
 extconf failure: need zlib


Gem files will remain installed in C:/MyProgrames/Ruby200-x64/lib/ruby/gems/2.0.0/gems/libxml-ruby-2.6.0 for inspection.

Results logged to C:/MyProgrames/Ruby200-x64/lib/ruby/gems/2.0.0/gems/libxml-ruby-2.6.0/ext/libxml/gem_make.out
@Pinyen

@dimitko I need to use nokogiri with Ruby 1.9.3 on Windows x64. However, I could not install it correctly. Is there any good way to solve the problem. Or I have to update my Ruby into 2.0? THX

Ruby Version: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

@dimitko

I don't know, @Pinyen. To be fair, I haven't tried Ruby 1.9.3 recently, nor do I want to. I want the speed and the new features of Ruby 2.0, and am prepared to take the risks of broken compatibility in my projects (and work overtime to port them if necessary). Frankly, I don't care about Ruby 1.9.3 anymore, openly admitting it.

@johnnyshields

@luislavena @flavorjones what is the latest on this thread? This is a blocker for using Ruby 2.0 on Windows.

@johnnyshields

@Pinyen, Nokogiri works fine with Ruby 1.9.3 (32-bit version) on Windows. Ruby 32-bit works on Windows x64. Are you using the Ruby One-Click installer? http://rubyinstaller.org/downloads/

@davispuh

This is a blocker for using Ruby 2.0 on Windows.

exactly, this is only reason why I haven't yet switched to Ruby 2.0 and I'm still using Ruby 1.9

@Pinyen

@dimitko Thanks for your reply! I will try Ruby 2.0 in the future~(Because the Rails Windows Installer for 2.0 is still alpha version)
@johnnyshields Thank you soooooo much! You help me successfully run my program! It really works on ruby 1.9.3
(I was using rails installer, so ,even my Ruby version is 1.9.3, Nokogiri still not work on the environment...)

Thanks for your help!!

@guyisra

+1

@jullig

@luislavena @flavorjones thank you for your hard work. Very much appreciated! It looks like the last status update was over a month ago. Any news or even projected date when this issue might be resolved?

@johnnyshields

@luislavena @flavorjones may we please have an update on this? Would Nokogiri team be able to use the pre-release rake-compiler to make the fat binary?

@factormystic

:+1: still waiting...

@jasonti

This is also a blocker for me upgrading to Ruby 2.0 on Windows... any progress?

@johnnyshields

Guys, please either give us an ETA or let us know where the remaining work is so we can contribute. It's been 2 months since the last substantive update on this thread.

@luislavena
Owner
@johnnyshields

@luislavena firstly apologies I have missed your response. Here's the link for all to see: https://groups.google.com/forum/#!topic/rubyinstaller/pI5gXxVGrsI

Specifically re: Nokogiri, does it make sense for Nokogiri team to try running rake-compiler pre-release at this stage? Or will the limitations you highlighted prevent it from working?

@luislavena
Owner

Yes, the pre-release is quite capable of handling this. The only issue is, as I mentioned, getting the right cross compiler. I recommend using a Linux box instead of osx.

@johnnyshields

@flavorjones are you able to try this? I can donate a VPS linux box if needed.

@johnnyshields

@flavorjones @tenderlove this issue is raining on my parade and I'd like to assist if possible. Looks like fat binary objects are not under source control. How can I contribute?

@nelittle nelittle referenced this issue in Albacore/albacore
Merged

Fix for nuspec.reference #60

@JonathanVeg

Hi guys, how it work? I already read all the messages but here nothing worked .. :(

@SumitBisht

@JonathanVeg A lot of gems are broken in win 64 bit. The only workaround that I am able to do is to install 32bit version of ruby 2.0.0p195 and its compatible Devkit. The gems are then getting installed fine on the 32 bit ruby platform (running on windows 8 64bit).

@Pepan

Is someone working on it? Is there any progress?

@gpad

@flavorjones Can I help on this issue? I clone the repo to start compiling (win 7 64bit ruby 2.0) I should fix something in rake-compiler, after that, I obtain this error:

cd tmp/x64-mingw32/nokogiri/2.0.0
C:/Ruby200-x64/bin/ruby.exe -I. ../../../../ext/nokogiri/extconf.rb
Cross-building nokogiri.
checking for libxml/parser.h... *** ../../../../ext/nokogiri/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.

I think that I should install libxml2, can you give me some hints?

@larskanis

Is there still some contribution wanted regarding to cross compile nokogiri for the x64-mingw32 platform? I could write the patch (as I did for pg, libusb, fxruby, sqlite), but want to ensure that no one is working on this topic already.

@johnnyshields

@larskanis check out the work going on here: tjschuck/rake-compiler-dev-box#2

@larskanis

@johnnyshields thank you for the pointer. I would ensure, that it runs on the rake-compiler-dev-box. @luislavena is working on mysql and sqlite for x64, so if it's OK, I'll try to do that for nokogiri.

@IgorJorobus
@davispuh

What's status on this now? It's been a while, can't wait that day :smile:

@glnarayanan

Has this been resolved? It's been a long while. Please fix this curse upon us poor Windows x64 users :(

@NenadP

Need Nokogiri X64 Windows support too please!

@shevegen

Nokogiri does not like windows!

@johnnyshields

Has anyone made progress here?

@luislavena
Owner

Hello folks,

Are you really needing to process/allocate more than 2GB of RAM in your Ruby processes? Because if not, then you don't need 64bits Ruby or Nokogiri.

You can perfectly run 32bits applications on 64bits Windows, there is no limitation on that.

The 64bits version of Ruby was made available for those doing really huge memory allocations (math involved) that needed more than 2GB, but safely your Rails app will not use more than 2GB, and if it does, then that is a bug.

But, if it really itches, here are some helpers:

The last bit might not apply as nokogiri now compiles the ports as part of extconf process, so running it inside the VM and compiling the extension should be enough, but YMMV.

@theglauber
@stibra

Running 32-bit Ruby 2.0 in Windows Servers (all 64-bit now) does not make any sense. Why running 32-bit code in the emulator? http://msdn.microsoft.com/en-us/library/windows/desktop/aa384249(v=vs.85).aspx
Also, really do not understand people who runs 32-bit Windows 7 or 8, what is point in that?

@qubitspace

There are lots of reasons people need to use 64 bit version of ruby, in my case we have 64 bit dll dependencies. Nokogiri is a little late to the x64 party, but the answer isn't to use a 32 bit version of Ruby for the next few years.

@luislavena
Owner

Why running 32-bit code in the emulator?

Please, get your facts right: http://msdn.microsoft.com/en-gb/library/windows/desktop/aa384219(v=vs.85).aspx

On the x64 processor, instructions are executed natively by the micro-architecture. Therefore, execution speed under WOW64 on x64 is similar to its speed under 32-bit Windows.

@luislavena
Owner

There are lots of reasons people need to use 64 bit version of ruby, in my case we have 64 bit dll dependencies.

Please name your dependencies that don't have 32bits version, I would love to see them.

the answer isn't to use a 32 bit version of Ruby for the next few years.

As I said: if it itches you, follow the two links I provided and instead of complaining, help.

If you don't want that, then use 32bits version and be happy.

@theglauber
@qubitspace
@luislavena
Owner

We've asked, we've begged, we've cried, and even offered help and resources, but it's not happening.

Then make it happen, all the conversation is here, really. Dunno what you offered as help and resources, to make things happen you need to get your hands dirty, I don't see that in the thread.

The tooling necessary to make it happen isn't rocket science. I mean, I've already put together all the pieces.

Have you ever tried to build the gem locally from a git clone, having a 64bits Ruby and corresponding DevKit? From the looks of recent code in master, it should build.

C'mon folks, I can't fix every single problem out there for every gem. There are more than 10K of gems that need compilation on Windows and I can't go and please everybody.

The same amount of time you waste bitching about there is no 64bits nokogiri could be used to actually help and get it done.

And please, before you reply and say that I'm ranting too hard, take a look to all the projects I've fixed to make it work on Windows, I will wait here... done? Good, now clone the repo and start testing to see if you can contribute back.

@sroller
@lolmaus

I have donated $15 on BountySource.com for resolving this issue: https://www.bountysource.com/issues/978124-support-ruby-x64-on-windows

If you're interested in resolving this issue but unable to participate in developing a fix, please participate in funding it (PayPal or Google Wallet).

@johnnyshields

@lolmaus I've matched your bounty, pot is up to $30

@larskanis

Sorry for being really late, but this issue is still on my agenda. I was just too busy last weeks to do any serious OSS development. That should change next week, but if someone jumps in before, that's great, too.

@Aaronontheweb Aaronontheweb referenced this issue from a commit in Aaronontheweb/albacore
nlittle unfortunately running on win x64 so can not run my tests. Was able to…
… validate that fix indeed works using albacore, just can't rake the test.

sparklemotion/nokogiri#864
6bb8a4c
@larskanis

Issue #989 adds x64 fat binary gem support and support for native builds from source gem on Windows. You could help reviewing it, by trying the installation based on the description in this pull request and by giving some feedback.

@Tridon

+1

@knu knu closed this in #989
@lolmaus

Yay!

I don't have a Windows machine at hand anymore, can someone please confirm it's working?

@lolmaus

I've got a Windows machine, set up Ruby, Ruby DevKit, Git... and was discouraged do find out that Nokogiri master branch lacks a gemspec.

So until a release candidate is built, i've got no idea how to try the fixed version.

@luislavena
Owner

@lolmaus the work was done to cross-compile the gem and produce binaries from within the repo.

The project uses Hoe and it has a gemspec task: rake gemspec will generate one for you, but as any generated file, is not committed to the repository, so you cannot use it with Bundler.

See the other thread about native compiling of the gem (perhaps with rake package) and cross-compiling using rake-compiler-dev-box.

@theglauber
@luislavena
Owner

@theglauber

Correct... not fixed yet. Baby steps are still good news.

This is fixed in the repository, that doesn't mean has been released as a gem.

Please understand that in order to release a new version of a gem several things needs to happen before, one of those is maintainers find the time to coordinate all the changes, build changelog, do some testing, etc. Not to mention the requirements on cross-compiling Windows native gems.

If you clone the repository you will be able to build the gem natively

BTW, your error:

ERROR:  Error installing mechanize:
        The 'unf_ext' native gem requires installed build tools.

Indicates you don't have compiler toolchain installed, and because of that, you cannot locally build Nokogiri (which might be possible due latest modifications released not long ago).

You might not have pre-compiled binaries yet.

@lolmaus

When will this fix be available for end users to try?

@wushuzh

Look forward to get the fixed version. Thanks very much.
Is it possible to forecast a date when it will available with gem version ?

@lolmaus

I have to vote for larskanis's claim for bounty until March 10th, but i'm unable to test his solution until the gem is released. What do i do?

@larskanis

@lolmaus: In order to install nokogiri on Windows-x64 from the git repository, before team nokogiri released the next official version, you need git and the DevKit properly installed. You can do:

git clone -n https://github.com/sparklemotion/nokogiri.git
cd nokogiri
git config core.autocrlf false
git checkout master -f
rake -rdevkit native gem
gem inst pkg\nokogiri-1.6.2.beta.2-x64-mingw32.gem

The test suite should also pass with rake test.

Update: I've updated the commands since #1061 is merged by now.

@lolmaus

Seems legit. :)

@starrychloe

Here is how to install Nokogiri gem with Chocolatey, Windows 8.1 x64, and DevKit x64.

http://stackoverflow.com/a/22210252/148844

@babelfish

@starrychloe That does not work for me, those packages are not in the Chocolatey repo.

@tknerr tknerr referenced this issue in tknerr/bills-kitchen
Closed

Issues with Ruby 2.0 #48

@stibra

Hi,

I have installed Nokogiri x64 with Chocolatey, but when running the application, I receive the error:

[tid-3001920] 126: The specified module could not be found. - C:/Ruby200/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1/lib/nokogiri/nokogiri.so (LoadError)
C:/Ruby200/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1/lib/nokogiri.rb:28:in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1/lib/nokogiri.rb:28:in
'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in
block (2 levels) in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in
block in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in
require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler.rb:131:in `require'

File nokogiri.so is in the good location.

@larskanis

@stibra: This seems to be some kind of unresolved DLL dependency. You could try Sysinternals depends tool.

However support for building nokogiri on Windows x86/x64 is already included in the git master branch, so it should work with the install instructions above. There is no need for Chocolatey.

@stibra

I will try later on other server. I have returned to Ruby 1.9.3.

I could not find the way how to install the gem without Chocolatey.

@hickford

I have Ruby 2.0 64-bit on Windows 7

> ruby -v
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

Nokogiri won't install

> gem install nokogiri
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb

C:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\nokogiri-1.6.1\ext\nokogiri>doskey ls=ls --color $*
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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.
@hickford

The issue is fixed in HEAD, please release a Gem to Rubygems.org . This is a killer issue for some people

@lwalley lwalley referenced this issue from a commit in SpeciesFileGroup/taxonworks
Lisa Walley Added basic authentication and CRUD actions for users.
Includes addition of capybara gem configured for feature tests.
Note capybara has runtime dependency on nokogiri and might not work
on Windows. See sparklemotion/nokogiri#864

Conflicts:
	app/models/user.rb
	app/views/layouts/application.html.erb
	config/routes.rb
	spec/models/user_spec.rb
	spec/spec_helper.rb
9e344e9
@udigolan udigolan referenced this issue in mitchellh/vagrant-aws
Open

fog update require unf gem #176

@flavorjones
Owner
@Quantumplation

Oh, yes please! This is currently killing progress on my project.

@starrychloe

@babelfish @stibra You have to include a repository from Microsoft to install with Chocolatey:
-Source "https://go.microsoft.com/fwlink/?LinkID=230477"
http://www.nuget.org/packages/libxml2/

@stibra

I did install it finally, but it does not work anyway.

@flavorjones
Owner

This was merged and released as 1.6.2.rc1 yesterday. Please try it out.

@qubitspace

This appears to be working great. Thanks to all who worked towards fixing this!

Release details here, you just have to install using --pre or specify the version.
https://groups.google.com/forum/#!topic/nokogiri-talk/hZCp6TPXekI

@larskanis

I did a test run on Windows 7 with the following RubyInstaller versions. Everything worked as expected:

Version Result
ruby 2.0.0p247 (2013-06-27) [i386-mingw32] 1279 tests, 2911 assertions, 0 failures, 0 errors, 3 skips
ruby 2.0.0p247 (2013-06-27) [x64-mingw32] 1279 tests, 2911 assertions, 0 failures, 0 errors, 3 skips
ruby 1.9.3p392 (2013-02-22) [i386-mingw32] 1311 tests, 3756 assertions, 0 failures, 0 errors, 3 skips

All above versions worked equally with the binary gem per gem inst nokogiri --pre as well as with native build gem inst nokogiri --pre --platform ruby if the matching Devkit is installed.

@knu
Owner
knu commented

@larskanis Thanks much for testing. Looks like Windows gems are building and working great!

@flavorjones
Owner
@danielricecodes

@larskanis I got the gem installed via Bundler successfully using Ruby 2.0.0 x64 on Windows 7. Many many thanks for contributing to this project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.