This help site has been deprecated. Please send your requests to support@rubygems.org
Installing RubyGems on machine not connected to Internet
I need to install RubyGems onto a machine that is isolated from the Internet (permanently offline). I appreciate your advice. I am new to Ruby & Gems and have read the Gems manual.
Please tell me if you see any problems with the following plan. The first 3 steps are on a PC that is connected to the Internet.
-
download RubyGems from http://rubyforge.org/frs/?group_id=126
-
Install RubyGems
-
Get the gems I need:
gem fetch cucumber --version 0.10.7 -
Sneeker-net the gems to the isolated machine.
-
Install the gems on the isolated machine:
gem install cucumber --version 0.10.7 --local
I still have some basic questions:
-
Do I need Ruby to run RubyGems commands?
-
Why is the "fetch" command not in the RubyGems manual?
-
Does "fetch" recursively download all the dependencies the way "install" does?
-
Does the "install" command do more than download a copy into the local machine?
If not, how is "install" different than "fetch"?
Thank you for helping.
Discussions are closed to public comments.
If you need help with RubyGems.org please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Eric Hodel on 02 Sep, 2011 09:00 PM
You need Ruby to use RubyGems.
gem help
is the authoritative reference for RubyGems commands.The easiest way to get the dependencies is
gem install -i tmp cucumber -v 0.10.7
then move tmp/cache/*.gem to the disconnected machine and rungem install -f --local *.gem
fetch only downloads a single gem file to the current directory. Install makes it usable by ruby.
2 Posted by wolf_volpi on 04 Sep, 2011 07:22 AM
Thanks Eric. I followed your instructions but got some errors. I probably got something wrong. Please take a look.
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.
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.
Thank you for your guidance.
3 Posted by Luis Lavena on 04 Sep, 2011 12:39 PM
Hello,
Your problem seems to be very particular.
This error:
Indicate it was unable to compile one of the extensions cucumber depends on.
As indicated in the results, please send us
mkmf.log
contents so we can see why it failed.You can find the file here:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.5.4/ext/json/ext/parser/
Most of the time, it is associated with some weird environment issues documented here:
https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting
Please verify that none of these issues are affecting your environment (speciall AutoRun)
4 Posted by wolf_volpi on 04 Sep, 2011 01:49 PM
Thanks Luis.
I followed the autorun trouble shooting. I have two different values for PathCompletionChar key; does that matter?
5 Posted by Luis Lavena on 04 Sep, 2011 01:55 PM
No, as the Troubleshooting page mentions, only AutoRun key matters.
The attached mkmf.log seems incomplete, is missing certain information.
Can you attach the file in verbatim format?
Thank you.
6 Posted by wolf_volpi on 04 Sep, 2011 02:17 PM
Luis,
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:
"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:
/ begin / 1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/ end /
7 Posted by Luis Lavena on 04 Sep, 2011 02:37 PM
Attached is how mkmf.log looks on my system. Notice the
have_header
mention there.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.
8 Posted by wolf_volpi on 04 Sep, 2011 03:29 PM
Luis,
I attempted gem install connected to the Internet:
It returned one "Failed to build gem native extension." Full output is attached.
The mkmf.log file appears unchanged, also attached.
9 Posted by wolf_volpi on 06 Sep, 2011 04:34 AM
I uninstalled all gems and attempted to install Cucumber gem again, but got the same error.
So now I want to uninstall DevKit before attempting another install.
What is the procedure for uninstalling DevKit?
Or should I just roll back to the previous restore point?
Thank you for your advice.
10 Posted by Luis Lavena on 06 Sep, 2011 10:31 AM
Hello,
Restore points will not handle that. You can remove DevKit directory safely.
I'm still baffled by something that works with internet connection but fails in your attempts of installation locally.
I'll try to reproduce this today.
11 Posted by Luis Lavena on 06 Sep, 2011 10:32 AM
Forgot to mention:
If you use the same Ruby installation to install the DevKit again, you will need to do
ruby dk.rb install --force
to override the existing configuration files.If you decide to remove your Ruby installation first, please also remove the Ruby directory afterwards before installing again.
12 Posted by wolf_volpi on 07 Sep, 2011 01:06 AM
Luis,
Thanks for the tips.
The previous Internet connected and local install attempts both failed: "Failed to build gem native extension."
In a few hours I will uninstall and attempt install again. I will post the results.
Thanks.
13 Posted by wolf_volpi on 07 Sep, 2011 04:18 AM
Luis,
Where is the DevKit directory? All I found is a devkit file C:/Ruby192/lib/ruby/site_ruby/devkit.rb
Thanks.
14 Posted by Luis Lavena on 07 Sep, 2011 10:24 AM
Did you follow the DevKit installation instructions?
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
DevKit will be where you extracted it.
As I mentioned before: the files that DevKit installed inside your current Ruby installation can be replaced using
ruby dk.rb install --force
so you can safely ignore those.Please also try a clean installation, meaning remove this Ruby installation, remove the directory and start again.
15 Posted by wolf_volpi on 08 Sep, 2011 12:14 AM
Luis,
OK, now I understand that "install DevKit" is the same as "extract DevKit file into directory".
My DevKit directory is D:\wolf\Software\cucumber\DevKit
My Ruby directory is C:\Ruby192
Should Ruby and DevKit be on the same partition?
16 Posted by Luis Lavena on 08 Sep, 2011 12:18 AM
Is not just extract, but follow the installation instructions in the wiki page.
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
Is not necessary both are on the same partition, but I recommend you extract it to
C:\DevKit
instead, so is close to your Ruby installation.17 Posted by wolf_volpi on 08 Sep, 2011 04:58 AM
It worked after a full unistall and reinstall. Thanks for your help Luis.
The following is the uinstall procedure I used if anyone else needs it.
Uninstall Cucumber gems, DevKit, DevKit, and Ruby from Windows 7:
from Windows PowerShell --------------------------------------
uninstall Cucumber gems:
PS C:\Users\wolf> gem list | %{$.split(' ')[0]} | %{gem uninstall -Iax $ }
from Command Prompt --------------------------------------
confirm all gems were deleted
remove DevKit directory:
remove Ruby from Control Panel:
remove the Ruby folder:
Luis Lavena closed this discussion on 14 Sep, 2011 11:31 AM.