tag:help.rubygems.org,2010-01-19:/discussions/questions/79-installing-rubygems-on-machine-not-connected-to-internetRubyGems.org: Discussion 2018-10-18T19:51:09Ztag:help.rubygems.org,2010-01-19:Comment/97037752011-09-02T21:00:56Z2011-09-02T21:00:56ZInstalling RubyGems on machine not connected to Internet<div><ol>
<li>
<p>You need Ruby to use RubyGems.</p>
</li>
<li>
<p><code>gem help</code> is the authoritative reference for
RubyGems commands.</p>
</li>
<li>
<p>The easiest way to get the dependencies is <code>gem install -i
tmp cucumber -v 0.10.7</code> then move tmp/cache/*.gem to the
disconnected machine and run <code>gem install -f --local
*.gem</code></p>
</li>
<li>
<p>fetch only downloads a single gem file to the current directory.
Install makes it usable by ruby.</p>
</li>
</ol></div>Eric Hodeltag:help.rubygems.org,2010-01-19:Comment/97037752011-09-04T07:22:45Z2011-09-04T07:22:45ZInstalling RubyGems on machine not connected to Internet<div><p>Thanks Eric. I followed your instructions but got some errors. I
probably got something wrong. Please take a look.</p>
<p>I am trying to install the Cucumber Gem on my home PC off-line
before I attempt the install at work. After downloading all the
necessary files, I disconnected the Ethernet cable from my PC, to
simulate an off-line installation.</p>
<p>Attached is a play-by-play of my attempted install, error
messages included. The first part is setting up Ruby on Windows 7.
You can skip down to “Cucumber download & install”.
Installing Cucumber generated 130 lines of output with 3
RuntimeErrors. I don't know enough about Gems to make sense of the
Error messages. Please help me figure out the error messages.</p>
<p>Thank you for your guidance.</p></div>wolf_volpitag:help.rubygems.org,2010-01-19:Comment/97037752011-09-04T12:39:30Z2011-09-04T12:39:30ZInstalling RubyGems on machine not connected to Internet<div><p>Hello,</p>
<p>Your problem seems to be very particular.</p>
<p>This error:</p>
<pre>
> gem install -f --local *.gem
Successfully installed builder-3.0.0
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing cucumber-0.10.7.gem:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
checking for re.h... *** 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.
</pre>
<p>Indicate it was unable to compile one of the extensions cucumber
depends on.</p>
<p>As indicated in the results, please send us
<code>mkmf.log</code> contents so we can see why it failed.</p>
<p>You can find the file here:
<code>C:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.5.4/ext/json/ext/parser/</code></p>
<p>Most of the time, it is associated with some weird environment
issues documented here:</p>
<p><a href=
"https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting">https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting</a></p>
<p>Please verify that none of these issues are affecting your
environment (speciall AutoRun)</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/97037752011-09-04T13:49:33Z2011-09-04T13:49:33ZInstalling RubyGems on machine not connected to Internet<div><p>Thanks Luis.<br>
I followed the autorun trouble shooting. I have two different
values for PathCompletionChar key; does that matter?</p>
<pre>
<code>D:\wolf\Software\cucumber\tmp\bin\cache
> SET COMSPEC
ComSpec=C:\Windows\system32\cmd.exe
D:\wolf\Software\cucumber\tmp\bin\cache
> REG QUERY "HKCU\Software\Microsoft\Command Processor"
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
CompletionChar REG_DWORD 0x9
DefaultColor REG_DWORD 0x0
EnableExtensions REG_DWORD 0x1
PathCompletionChar REG_DWORD 0x9
D:\wolf\Software\cucumber\tmp\bin\cache
> REG QUERY "HKLM\Software\Microsoft\Command Processor"
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor
CompletionChar REG_DWORD 0x40
DefaultColor REG_DWORD 0x0
EnableExtensions REG_DWORD 0x1
PathCompletionChar REG_DWORD 0x40</code>
</pre></div>wolf_volpitag:help.rubygems.org,2010-01-19:Comment/97037752011-09-04T13:55:42Z2011-09-04T13:55:42ZInstalling RubyGems on machine not connected to Internet<div><p>No, as the Troubleshooting page mentions, only AutoRun key
matters.</p>
<p>The attached mkmf.log seems incomplete, is missing certain
information.</p>
<p>Can you attach the file in verbatim format?</p>
<p>Thank you.</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/97037752011-09-04T14:17:15Z2011-09-04T14:17:15ZInstalling RubyGems on machine not connected to Internet<div><p>Luis,</p>
<p>What is " verbatim format"? I opened the attachment and it looks
just like the mkmk.log file on my PC. Here is mkmk.log pasted into
the comment:</p>
<p>"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32
-IC:/Ruby192/include/ruby-1.9.1/ruby/backward
-IC:/Ruby192/include/ruby-1.9.1 -I. -O3 -g -Wextra
-Wno-unused-parameter -Wno-parentheses -Wpointer-arith
-Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -O3
-Wall conftest.c -L. -LC:/Ruby192/lib -L.
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\tk\lib
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\tcl\lib
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\libyaml\lib
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\pdcurses\lib
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\openssl\lib
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\zlib\lib
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\iconv\lib
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\gdbm\lib
-LC:\Users\Luis\Projects\oss\oneclick\rubyinstaller\sandbox\libffi\lib
-lmsvcrt-ruby191-static -lshell32 -lws2_32 " checked program
was:<br>
/ <em>begin</em> / 1: #include "ruby.h"<br>
2:<br>
3: #include <winsock2.h><br>
4: #include <windows.h><br>
5: int main() {return 0;}<br>
/ <em>end</em> /</p></div>wolf_volpitag:help.rubygems.org,2010-01-19:Comment/97037752011-09-04T14:37:14Z2011-09-04T14:37:14ZInstalling RubyGems on machine not connected to Internet<div><p>Attached is how mkmf.log looks on my system. Notice the
<code>have_header</code> mention there.</p>
<p>Can you attempt normal installation of the gem with internet?
want to see if the error is coming because of local gem
installation since it worked before in your system.</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/97037752011-09-04T15:29:00Z2011-09-04T15:29:00ZInstalling RubyGems on machine not connected to Internet<div><p>Luis,</p>
<p>I attempted gem install connected to the Internet:</p>
<pre>
<code>gem install cucumber --version 0.10.7</code>
</pre>
<p>It returned one "Failed to build gem native extension." Full
output is attached.<br>
The mkmf.log file appears unchanged, also attached.</p></div>wolf_volpitag:help.rubygems.org,2010-01-19:Comment/97037752011-09-06T04:34:34Z2011-09-06T04:34:34ZInstalling RubyGems on machine not connected to Internet<div><p>I uninstalled all gems and attempted to install Cucumber gem
again, but got the same error.</p>
<p>So now I want to uninstall DevKit before attempting another
install.<br>
What is the procedure for uninstalling DevKit?<br>
Or should I just roll back to the previous restore point?</p>
<p>Thank you for your advice.</p></div>wolf_volpitag:help.rubygems.org,2010-01-19:Comment/97037752011-09-06T10:31:23Z2011-09-06T10:31:23ZInstalling RubyGems on machine not connected to Internet<div><p>Hello,</p>
<p>Restore points will not handle that. You can remove DevKit
directory safely.</p>
<p>I'm still baffled by something that works with internet
connection but fails in your attempts of installation locally.</p>
<p>I'll try to reproduce this today.</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/97037752011-09-06T10:32:34Z2011-09-06T10:32:34ZInstalling RubyGems on machine not connected to Internet<div><p>Forgot to mention:</p>
<p>If you use the same Ruby installation to install the DevKit
again, you will need to do <code>ruby dk.rb install --force</code>
to override the existing configuration files.</p>
<p>If you decide to remove your Ruby installation first, please
also remove the Ruby directory afterwards before installing
again.</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/97037752011-09-07T01:06:12Z2011-09-07T02:49:09ZInstalling RubyGems on machine not connected to Internet<div><p>Luis,</p>
<p>Thanks for the tips.</p>
<p>The previous Internet connected and local install attempts both
failed: "Failed to build gem native extension."</p>
<p>In a few hours I will uninstall and attempt install again. I
will post the results.</p>
<p>Thanks.</p></div>wolf_volpitag:help.rubygems.org,2010-01-19:Comment/97037752011-09-07T04:18:19Z2011-09-07T04:18:19ZInstalling RubyGems on machine not connected to Internet<div><p>Luis,</p>
<p>Where is the DevKit directory? All I found is a devkit file
C:/Ruby192/lib/ruby/site_ruby/devkit.rb</p>
<p>Thanks.</p></div>wolf_volpitag:help.rubygems.org,2010-01-19:Comment/97037752011-09-07T10:24:53Z2011-09-07T10:24:53ZInstalling RubyGems on machine not connected to Internet<div><p>Did you follow the DevKit installation instructions?</p>
<p><a href=
"https://github.com/oneclick/rubyinstaller/wiki/Development-Kit">https://github.com/oneclick/rubyinstaller/wiki/Development-Kit</a></p>
<p>DevKit will be where you extracted it.</p>
<p>As I mentioned before: the files that DevKit installed inside
your current Ruby installation can be replaced using <code>ruby
dk.rb install --force</code> so you can safely ignore those.</p>
<p>Please also try a clean installation, meaning remove this Ruby
installation, remove the directory and start again.</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/97037752011-09-08T00:14:42Z2011-09-08T00:14:42ZInstalling RubyGems on machine not connected to Internet<div><p>Luis,</p>
<p>OK, now I understand that "install DevKit" is the same as
"extract DevKit file into directory".<br>
My DevKit directory is D:\wolf\Software\cucumber\DevKit<br>
My Ruby directory is C:\Ruby192<br>
Should Ruby and DevKit be on the same partition?</p></div>wolf_volpitag:help.rubygems.org,2010-01-19:Comment/97037752011-09-08T00:18:33Z2011-09-08T00:18:33ZInstalling RubyGems on machine not connected to Internet<div><blockquote>
<p>OK, now I understand that "install DevKit" is the same as
"extract DevKit file into directory".</p>
</blockquote>
<p>Is not just extract, but follow the installation instructions in
the wiki page.</p>
<p><a href=
"https://github.com/oneclick/rubyinstaller/wiki/Development-Kit">https://github.com/oneclick/rubyinstaller/wiki/Development-Kit</a></p>
<p>Is not necessary both are on the same partition, but I recommend
you extract it to <code>C:\DevKit</code> instead, so is
<em>close</em> to your Ruby installation.</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/97037752011-09-08T04:58:58Z2011-09-08T04:58:58ZInstalling RubyGems on machine not connected to Internet<div><p>It worked after a full unistall and reinstall. Thanks for your
help Luis.<br>
The following is the uinstall procedure I used if anyone else needs
it.</p>
<p>Uninstall Cucumber gems, DevKit, DevKit, and Ruby from Windows
7:</p>
<p>from Windows PowerShell
--------------------------------------<br>
uninstall Cucumber gems:<br>
PS C:\Users\wolf> gem list | %{$<em>.split(' ')[0]} | %{gem
uninstall -Iax $</em> }</p>
<p>from Command Prompt --------------------------------------<br>
confirm all gems were deleted</p>
<pre>
<code>gem list
*** LOCAL GEMS ***</code>
</pre>
<p>remove DevKit directory:</p>
<pre>
<code>D:
cd D:\wolf\Software\cucumber\
rd /s DevKit</code>
</pre>
<p>remove Ruby from Control Panel:</p>
<pre>
<code>Control Panel > Programs > Uninstall > select Ruby, click Unistall</code>
</pre>
<p>remove the Ruby folder:</p>
<pre>
<code>rd /s Ruby192</code>
</pre></div>wolf_volpi