trouble with script/plugin discover

When I run ruby script/plugin discover it adds quite a few entries before getting to the following and doing this:

`

Add ? [Y/n] Add ? [Y/n] (eval):3:in each': undefined method ’ for nil:NilClass (NoMethodError) from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/plugin.rb:6 58:in scrape' from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/plugin.rb:6 32:in parse!’ from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/plugin.rb:6 31:in parse!' from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/plugin.rb:4 47:in parse!’ from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/plugin.rb:4 63:in parse!' from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/plugin.rb:8 71 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in re quire’ from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_suppo rt/dependencies.rb:147:in require' from script/plugin:3

Is anyone else having this problem?

Jeremy

i see other people are having this same problem. if you want to fix it then open up ruby/lib/ruby/gems/rails-1.1.6/lib/commands/plugin.rb, find the class Discover, the method def scrape(uri) and the line

`if uri =~ //plugins// and uri !~ //browser//

`and change it to

if uri =~ /\/plugins\// and uri !~ /\/browser\// and uri =~ /(svn|https?):\/\//

Jeremy Wells wrote:

Hi Jeremy,

Jeremy Wells wrote:

i see other people are having this same problem. if you want to fix it then open up ruby/lib/ruby/gems/rails-1.1.6/lib/commands/plugin.rb, find the class Discover, the method def scrape(uri) and the line

if uri =~ /\/plugins\// and uri !~ /\/browser\//

and change it to

if uri =~ /\/plugins\// and uri !~ /\/browser\// and uri =~ /(svn|https?):\/\//

Thanks very much for the patch... works like a charm! Question though: I found the following ticket:

  http://dev.rubyonrails.org/ticket/5736

with a comment from rick saying: "Fixed in edge awhile ago. It'll be available for 1.2"... does your patch correspond to the 1.2 fix mentioned in the ticket? Thanks,

Peter V.

Peter Vandenberk wrote:

Thanks very much for the patch... works like a charm! Question though: I found the following ticket:

  http://dev.rubyonrails.org/ticket/5736

with a comment from rick saying: "Fixed in edge awhile ago. It'll be available for 1.2"... does your patch correspond to the 1.2 fix mentioned in the ticket? Thanks,   

Hi Peter, I didn't refer to the 1.2 source to fix the problem, but I've just had a look, and the fix is similar (but not exactly the same). My fix just ensures that the string is a url (the error was being caused by a matched string that was a file path but not a url path) whereas the fix in 1.2 seems to do more specific validation.