On Dec 16, 9:32 pm, "[email protected]"
<[email protected]> wrote:
> Hi All:
>
> So I'm running rails 2.1.2, ruby 1.8.7 (2008-08-11 patchlevel 72), and
> thinking-sphinx as gem 1.3.13 on both ubuntu 8.10 (production) and osx
> leopard (development).
>
> thinking-sphinx runs fine on osx, but any search on ubuntu generates a
> stack trace like this:
Hey. I've got the same problem. I'm running ubuntu linux (8.04), rails
2.3.5, thinking_sphinx 1.3.13.
I discovered that this 'local-options' problem arises when my app in
run in the browser, but NOT under console. My controller method is the
following:
def search
@posts = Post.search params[:q], :page => params[:page]
# hack! hack! hack! thinking_sphinx does not include virtual
attributes in results
@posts.each do |post|
...
end
render
end
Running the app via the browser, and executing that controller action,
makes rails barf at the line: "@posts.each do |post|". Here is the
trace:
/home/peter/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/
whiny_nil.rb:52:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.13/lib/thinking_sphinx/
search.rb:346:in `client'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.13/lib/thinking_sphinx/
search.rb:258:in `populate'
/home/peter/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/
core_ext/benchmark.rb:10:in `realtime'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.13/lib/thinking_sphinx/
search.rb:257:in `populate'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.13/lib/thinking_sphinx/
search.rb:380:in `call'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.13/lib/thinking_sphinx/
search.rb:380:in `retry_on_stale_index'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.13/lib/thinking_sphinx/
search.rb:254:in `populate'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.13/lib/thinking_sphinx/
search.rb:209:in `each_with_group_and_count'
/home/peter/apps/ysc/config/initializers/savage_beast_extensions.rb:
8:in `search'
That last line of the trace -- /home/peter/apps/ysc/config/
initializers/savage_beast_extensions.rb:8:in `search' -- refers to the
"@posts.each do |post|" line in the "search" method above.
Now, I can run this same controller action from within console as
follows:
>> app.get '/posts/search?q=cancer'
=> 200
>> app.response.body
=> "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> ...
etc ... etc
In console, there's no problem at all with this action. The action
renders a proper set of search results. No exception is raised.
So this seems to be a bug in TS having to do with:
1. linux vs. osx
2. the difference between running code in a browser vs. running the
same code under console
Weird.
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.