There is much confusion among the Ruby gems and Rails plugin.
Leave a link that I found interesting in clarifying some concepts:
In general, when you install a gem in your Ruby environment you can use it in all Rails applications on the same Ruby environment (if the gem is compatible with the version of Rails to use).
For example, if you install the will_paginate gem, any new application can use it too.
If you are using Rails 2.x, it is desirable that the environment.rb file of each new application that uses this gem add a dependency to this gem.
Following the example of will_paginate, it would, within the initializer block:
Rails:: Initializer.run do |config| #.... config.gem 'will_paginate', :version => '~> 2.3.11', :source => 'http://gemcutter.org' # .. end
(you can add the version and the source you want)
Thus, if the gem is not installed, the application will not load and demonstrative a message that you can not find this gem. To install this gem, and any other, you can use:
rake gems: install
and all necessary gems will be installed.
On the other hand, you can use a Rails plugin instead of a gem. In this case, the plugin will be installed inthe folder: my_app/vendor/plugins/ and the scope is for that application.
Many sources of plugins were passed to "github":https://github.com/ , so you should make sure the plugin source is correct (it may even be many branches of the same plugin)
For install the plugin in exception_notification Rails 2.x you could use git clone (For the log, I assume you are using Windows).
Eg. from the root of your project:
C:\ror\my_app>git clone git://github.com/jeremyevans/exception_notification.git vendor/plugins/exception_notification
where you will get something like:
Initialized empty Git repository in C:/ror/my_app/vendor/plugins/exception_notification/.git/ remote: Counting objects: 180, done. remote: Compressing objects: 100% (81/81), done. remote: Total 180 (delta 87), reused 165 (delta 81) Receiving objects: 100% (180/180), 25.60 KiB, done. Resolving deltas: 100% (87/87), done.
and see the plugin installed on my_app\vendors\exception_notification
Then, u could follow the instructions my_app\vendors\exception_notification*README* to configure and use it.
Make sure you have git installed, if not, you can use eg. "msysgit":http://code.google.com/p/msysgit/ and verify that the version of the plugin you use is compatible with your Rails version.
I hope you can install and use the plugin.
Let me know if you need some extra help.
Probably you have problem with the Net connection or some DNS issue at your side..
I am a newbie to rails. I am trying to install the exception notification plugin into my rails app and get it up and running, I am unable to do it.
In case of plugins do we just need to copy and paste them in our vendor/plugins directory.If thats done we need not install them explicitly?, in order to get them up & running(integrate them) in our rails app.
If its an external plugin, we need not give a require "plugin_name" in our enviroment.rb file? Is that given only when we make use of ruby gems?
I already have exception_notification (1.0.20090728) gem installed in my gem list, I am using Rails 2.0.2, Ruby 1.8.7 for project specific purpose.
Apart from this, I have a exception_notification plugin copied to my vendor/plugins directory.
Could you please tell me if there would be a conflict between the gem and the plugin? If so how should I deal with it, how do I make sure that only the plugin is used and not the gem?
The error I am currently getting when I try to install the exception_notification plugin is:-
ruby script/plugin install exception_notification
/usr/lib/ruby/1.8/timeout.rb:60:in `rbuf_fill': execution expired
from /usr/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill' from /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline' from /usr/lib/ruby/1.8/net/http.rb:2024:in `read_status_line' from /usr/lib/ruby/1.8/net/http.rb:2013:in `read_new' from /usr/lib/ruby/1.8/net/http.rb:1050:in `request' from /usr/lib/ruby/1.8/open-uri.rb:248:in `open_http' from /usr/lib/ruby/1.8/net/http.rb:543:in `start' from /usr/lib/ruby/1.8/open-uri.rb:242:in `open_http' from /usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open' from /usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop' from /usr/lib/ruby/1.8/open-uri.rb:162:in `catch' from /usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop' from /usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri' from /usr/lib/ruby/1.8/open-uri.rb:518:in `open' from /usr/lib/ruby/1.8/open-uri.rb:30:in `open' from
I am unable to figure out whats the reason behind this and what steps need to be taken to rectify this. Any suggestions?