Ich habe Windows 8 und muss Ruby 2.1.2 für ein Projekt installieren. Ich habe diese Anweisungen befolgt . Ich entpackte die Quelle in C:\Ruby2.1.2\src\, lief nmakein C:\Ruby2.1.2\build\und lief nmake installmit dem Zielordner C:\Ruby2.1.2\bin\. Bei der Installation von Ruby 2.1.2 sind folgende Fehler aufgetreten:
configuring zlib
Failed to configure zlib. It will not be installed.
Dies geschah für dbm, fiddle, gdbm, openssl, pty, readline, syslog, tk, tk / tkutil und zlib. Die Tests sind jedoch in nmake testjedem Fall erfolgreich.
Ich habe bereits Ruby 2.0.0 und 1.9.3, aber ich brauche 2.0.0 für andere Projekte. Ich verwende pik 0.3.0.pre , um die Abhängigkeiten zu verwalten, und es scheint für 2.0.0 und 1.9.3 zu funktionieren.
Wenn ich jedoch gem installfür irgendetwas auf Ruby 2.1.2 umsteige , erhalte ich:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Nach einigem Graben, versuchte ich zu C Navigation: \ Ruby2.1.2 \ src \ ruby-2.1.2 \ ext \ zlib und läuft ruby extconf.rbDer Fehler , den ich dafür bekam , war:
checking for deflateReset() in z.lib... *** 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:/Ruby2.1.2/bin/usr/bin/ruby
--with-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-zlib
--without-zlib
C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:556:in `try_link'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:742:in `try_func'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:973:in `block in have_library'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from C:/Ruby2.1.2/bin/usr/lib/ruby/2.1.0/mkmf.rb:968:in `have_library'
from extconf.rb:13:in `block in <main>'
from extconf.rb:13:in `each'
from extconf.rb:13:in `find'
from extconf.rb:13:in `<main>'
Es sieht so aus, als müsste ich Entwicklungstools installieren. Aber die einzige Quellen fand ich über die Installation von Entwicklungs - Tools hat mich zu RubyInstaller , die nicht Ruby - 2.1.2 noch hat.
Ich habe auch versucht, zlib separat zu installieren und auszuführen ruby extconf.rb --with-zlib-dir="C:\Program Files (x86)\GnuWin32", aber das gab mir den zweiten Fehler erneut.
Eine andere Sache, die ich versuchte, lief gem install zlib -- --with-zlib-dir="C:\Program Files (x86)\GnuWin32", aber das gab mir den ersten Fehler wieder.
Wie installiere ich Entwicklungstools, damit Rubygems funktionieren?