This help site has been deprecated. Please send your requests to support@rubygems.org

Installing gems with no network

If you have no network connection or are behind a very restrictive firewall you may find it difficult to install gems.

Downloading and installing gems

Here is how you work around this problem, provided you have an alternate way of moving the files.

  1. Install the gems on an internet-connected computer to a temporary directory. Since we're only interested in the files, also disable documentation generation:
    $ gem install rails -i repo --no-rdoc --no-ri
    
  2. RubyGems has downloaded all the .gem files and placed them in gems/cache. Copy this directory to a USB drive or use a secure network to transfer it:
    $ cp -r repo/cache /path/to/USB_drive/gems
    
  3. Install the gems on the destination machine from the local files:
    $ cd /path/to/USB_drive/gems
    $ gem install --force --local *.gem
    

Dealing with multiple platforms

If the platform of the computer downloading the gems does not match the platform of the computer installing the gems (linux download, windows install) you may need to override it. To override the platform:

  1. Determine the platform of the target machine:
    $ gem env
    

    You are looking for "RUBYGEMS PLATFORMS", it will look like:

    • RUBYGEMS PLATFORMS:
      • ruby
      • x86-mingw32
      • x86-mswin32-60

    The platform you are looking for is like "x86-mswin32-60"

  2. Provide this platform to RubyGems for step 1 of downloading the gems with the --platform option:
    $ gem install nokogiri --platform x86-mswin32-60 -i repo --no-rdoc --no-ri
    
  3. Follow the remaining instructions