views:

16

answers:

2

If installing a gem using

gem install ______

actually install 6 gems, because of the dependencies, then if the gem is installed as plugin by

script/plugin install git://github.com/author/____.git

or

script/plugin install _____

then we to manually install the gem it depends on?

Does it matter if it is the later form, where it doesn't get it from github?

A: 

If you're worried about gems and dependencies, plugins are probably not the way to go. I would recommend checking out Bundler. It allows you to lock your gem versions and makes it really easy to manage gem sets across multiple servers, and developers.

Beerlington
can't use Bundler because it is Rails 2.2.2... it seems... or the team is not using Bundle for this Rails project
動靜能量
A: 

Plugins are supposed to include their own dependencies inside them so you'll have:

# my_rails_project/vendor/plugins/thatfancyplugin/vendor/<their dependencies>

If the plugin you're looking at includes those other gems inside the repo, you'll be fine to just install the plugin. I expect it doesn't though which would require you to explicitly define the requirements in your config/environment.rb file.

It's for this reason that I'd recommend using it as a gem, because then you don't have to manually specify requirements that shouldn't be concerning you. A number of plugins have changed their recommended installation instructions telling people to install as a gem instead of a plugin, which is I expect mostly for this reason.

Jeremy