Question : Ruby - what is a plugin vs. a gem and how do I install them?

Hi folks,

I've been asked to set up Ruby 1.8.6, Rails 2.1.0, and Gems 1.2.0 for a developer so they can do a project for us.  Downloading and installing the bases of each turned out to be pretty simple, but now we are being asked to install the following "gems" that do not appear to be gems at all:

- action_mailer_optional_tls
http://github.com/collectiveidea/action_mailer_optional_tls/tree/master

- acts_as_list
http://github.com/rails/acts_as_list/tree/master

- ujs_sort_helper
http://github.com/pengwynn/ujs_sort_helper/tree/master

- validates_date_time
http://svn.viney.net.nz/things/rails/plugins/validates_date_time

Now, my total time of familiarity with Ruby is about 8 hours and counting, but as far as I can tell, the above are all "plugins" and not gems.

1) Can anyone verify that the above are indeed "plugins" and not "gems"?

2) If they are plugins, how do I install them?  If they are gems, why can I not install them using the "gem install" command?

3) Can someone point me to a brief but effective tutorial on the difference between a plugin and a gem?

Thanks in advance.  This is driving me mad.

Answer : Ruby - what is a plugin vs. a gem and how do I install them?

Correct, these are not gems but RoR plugins. Rails plugins are not gems; they install to the subdirectory of an existing rails project. They are managed similarly to gems but do not require the rubygems framework; instead they require an existing rails application.

First, create the application skeleton like this:

rails myapplication (this creates a directory)
cd myapplication

From there, you can install rails plugins like this:

ruby script/plugin install action_mailer_optional_tls

... and so on. You may have to run "ruby script/plugin update" Then, look in the vendor/plugins subdirectory to ensure that the plugin was successfully installed.
Random Solutions  
 
programming4us programming4us