Search code examples
rubyrubygemscompass-sass

Download all gems dependencies


I want to install compass by downloading any required file and taking them to another machine without internet connection. I have downloaded the source package for compass and when I run gem on it in the non connected machine it complains about missing dependencies. Any solution?


Solution

  • That's precisely the problem I had.

    After searching around for a while I found a solution that works using Bundler https://bundler.io/

    Getting Gem with Dependencies:

    • Create a new Folder with a File named Gemfile.
    • Write a Source and the Gem you want to have the dependencies for into the File
    • Example:

      source "http://rubygems.org"
      gem 'rails', '3.2.1'

    • Open a Commandline at this Folder and Execute: bundle install
    • This should download and install all dependencies
    • Execute the Command bundle list if you wanna see it
    • Execute the Command bundle package
    • This should create the Directory Structure vendor/cache
    • Inside the cache directory are now all the dependencies you need for your gem

    Install Gem on Machine without internet connection:

    • Copy the cache Folder to the Machine
    • Open a Commandline inside the Cache Folder and execute gem install --local Gemname.gem
    • Example:

    gem install --local rails-3.2.1.gem