Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 783
Sergio Avatar asked Dec 09 '10 20:12

Sergio


People also ask

How do I download RubyGems?

Open up the 'Software Center' app from your launcher and type in `RubyGems` without quotes into the application search box at the top right, and press [enter]. RubyGems then can be installed by just clicking on the button labeled 'Install', thats it.

How do I download Gemfile?

run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from.

How do I install bundles to install missing gems?

In the invoked popup, start typing bundler, select bundle install and press Enter . Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .


1 Answers

Thats exactly the problem I had.
After searching around a while I found a Solution who works using Bundler https://bundler.io/

Getting Gem with Dependencies:

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

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

  • Open a Commandline at this Folder an Execute: bundle install
  • This should download and install all Dependencys
  • 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 Dependencys 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

like image 115
jadephantom Avatar answered Sep 18 '22 17:09

jadephantom