views:

58

answers:

2

the extracted source is below

Showing /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/templates/rescues/diagnostics.erb where line # raised:

private method `gsub' called for #<NoMethodError: undefined method `closed?' for nil:NilClass>

Extracted source (around line #):

RAILS_ROOT: /home/sharath/Desktop/RORWorkspace/ITPLOW1

It was working before installing Sunspot: A Solr-Powered Search Engine for Ruby

i am working in ubuntu 10.4

A: 

What's probably happening is you're attempting to do a substitution on some variable which you thought you were initializing, but neglected to give a real value.

For instance, if you had a form where for a Message and one of the the properties you want is the content, you would normally retrieve that information in the controller with

params[:message][:content]

And if you wanted to filter it, you would do something like

params[:message][:content].gsub(/<[^>]*>/,"")

But if the user didn't enter anything into the content field, the params[:message][:content] variable wouldn't be set. Therefore it's null and you're attempting to do nil.gsub

Jamie Wong
Salil
Even if i fill the content i am getting same error
sharath
A: 

I'd need to see the full stacktrace to be sure, but this is actually probably an unhelpful HTTP connection error message bubbling up out of RSolr (the library the Sunspot uses for the low-level Solr connection). Is Solr running (i.e., did you run rake sunspot:solr:start)? Can you access http://localhost:8982/solr/admin ?

outoftime
thanks ya ... its working now after running sunspot ...i am new to this so i didnt known that u must run search engine
sharath