0

I want to distribute a ruby script to many of my friends, because it's useful. But how do I know what else they might have to install? I mean at the top of the script, there is this:

require 'rubygems'      #
require 'activerecord'  #TODO: figure out what packages this depends on
require 'activesupport' #
require 'duration'      #

That gives me some idea about what they need to install, but last time I tried it on a friend's computer(Linux) each of the above turned out to require move packages. For example, activesupport requires a database, which in case of this script is sqlite3, so I had to install sqlite3 and a bunch of lib and maybe even dev packages.

Is there any tool or method to gather up a list of all the dependencies so I can include them in installation instructions? Or even better, is there a way to package them into an easy installator?

ulver
  • 1,521
  • 16
  • 29

2 Answers2

2

Distribute it as a gem. The gem lets you add dependencies, and if a dependency has a dependency, the rubygems system will install it for you.

August Lilleaas
  • 54,010
  • 13
  • 102
  • 111
1

If you are requiring activerecord, you need some sort of activerecord adapter driver installed or the gem corresponding to the db, e.g. pg, mysql, sqlite-ruby as well as a connection set up to connect to said db.

Whenever you install gems using the current rubygems they will install dependencies, its just that activerecord is a bit ... "funny" ?

Omar Qureshi
  • 8,963
  • 3
  • 33
  • 35