Question

I've developed a Ruby application (a small game), and I would like to 'distribute' it to other people.

However, I am not sure what to do about the required gems. If I just send my application to someone who have ruby installed, but not the required gems, I assume it will blow up. Can I package the gems locally? If so, would it conflict if the other person has a different version of the gem?

So, what is the smart/proper/good way of doing this?

Was it helpful?

Solution

The best way would probably be to just package your game as a gem as well, that way rubygems will take care of installing the dependencies. Here's the documentation explaining how to create your own gems.

OTHER TIPS

If you'd rather not package your game as a gem, you could investigate the Bundler, which will be integrated into Rails 3.

In your environment.rb you can express your gem dependencies, eg.

  config.gem "activemerchant", :lib => "active_merchant", :version => "1.4.1"

This isn't as automatic as gem dependencies, but it certainly usable. User must sudo rake gems:install to get your app to start.

If you're looking for a way to create OSX .dmg's and Windows Installers, there's a gem called releasy that will do all of that for you, and it is specifically tailored for releasing GUI apps written in Ruby. It bundles up Ruby and all your gem dependencies in to a single executable so that your end user doesn't have to install anything extra.

You will need access to a Windows/OSX environment to make the installers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top