views:

71

answers:

3

On http://github.com/collectiveidea/delayed_job

it says:

To install as a gem, add the following to config/environment.rb:
config.gem 'delayed_job'
Run rake gems:install

versus

To install as a plugin:
script/plugin install git://github.com/collectiveidea/delayed_job.git

What is the difference between installing it as a gem or as a plugin?

Also, the first method just install gem 2.0.3 which might be the tobi's version? (rake gems:install installs the version by gem list -r delayed_job) Is it http://github.com/tobi/delayed_job ? The "plugin" method specifically says it is the collectiveidea version? Doesn't it matter which one you install?

+1  A: 

That are 2 different repositorys, maybe you shoult try

config.gem 'delayed_job', :source => http://github.com/collectiveidea/delayed_job.git

Look at: http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies

Btw. maybe you want to look at a maybe better solution: resque - see http://ruby-toolbox.com/categories/queueing.html for a comparison of used queing gems

Lichtamberg
by the way, if I google `delayed_job 2.0.3` there is a link to rubygems.org that links to the collectiveidea's version.
動靜能量
+1  A: 

When you install a gem it will be available for all apps, in case you use a plugin - just for an app it's installed into.

fantactuka
+1  A: 

Both the Gem and the vendored plugin refers to the collectiveidea's fork. In fact, collectiveidea is the current maintainer for the delayed_job Gem on RubyGems.

That said, generally speaking installing a plugins as a Gem has many advantages.

  • You can install it once and use it in many different projects
  • You can take advantage of dependency resolution
  • You can upgrade just changing version number
  • You don't need to store the entire plugin code in your SCM

So, why you can install a plugin "as a plugin"? There are many different answers.

At the very beginning, Rails plugins came as simple libraries. Time passes and developers started to notice the advantage of packaging plugins as Gem.

Also, before Rails 3, some plugin features were only reserved to plugins and not to Gems. For instance, before Rails 3, plugins could bundle rake tasks while there wasn't a way to inject new rake tasks or new routes into the main application.

In the last two years, the most part of Rails plugins offers the ability to be installed as a plugin or as a Gem. With Rails 3 and the arrival of Bundler, I'm sure plugins are going to be deprecated in favor of Gems.

Simone Carletti