views:

97

answers:

2

Hi all,

I was wondering if there was a solution to automatically - from my ruby source code - ask Gem to install various librairies my code my require to work?

From what i read on the internet, it seems we are obliged to either use an install script that directly runs "gem install ..." commands or do it manually or some people have posted a ruby script that simply iterate over a list of dependencies and use the system command to install them.

Any other better options?

Thanks for your time.

+1  A: 

You could use internal RubyGems commands, but that's a pain and error-prone process, especially for dependencies.

I would setup a Gemfile and use Bundler instead. http://github.com/carlhuda/bundler

qrush
A: 

How is it possible to auto install gems automatically when the application is run without having to type "bundle install" in terminal previously? What is the code? I have been trying to do so, but the only thing that i succeeded with was to bypass rubygems so that application has its own local repository with gems, and that it uses these rather than gems on ruby path load (by creating a preinitializer.rb). I am using bundler 0.9.11 and rails 2.3.5.

Jazz