Translate

January 17, 2013

How to installing gems when no network

If you have a system with no network connection or you have very restricted firewall connection then its very difficult to install gems.Here is simple work around to solve such problem. You at least need a way to move the files on system.
  • Step 1: Install the required gem on internet connected computer. You can disable the document generation if you desire.
    $ gem install gem_name -i dir_name --no-rdoc --no-ri
    

  • Step 2:  RubyGems has downloaded all the .gem files and placed them in dir_name/cache. You need to Copy this directory to a USB pen drive or some thing else to move directory to the target system. you can use a secure network to transfer it.
  • $ cp -r dir_name/cache /path_to/usb_pen_drive/gems
    

  • Step 3: Install the gems on the target system from the local files
  • $ cd /path_to/usb_pen_drive/gems
    $ gem install --force --local *.gem
    
Thats it ... Your system has a required gem installed

No comments: