Raspell plugin method_missing error

52 views
Skip to first unread message

Peter Akkies

unread,
Dec 9, 2009, 12:09:47 AM12/9/09
to Thinking Sphinx
Hey Pat,

I visited the following page regarding somebody who had a problem
running the Raspell plugin:

http://github.com/freelancing-god/thinking-sphinx-raspell/issues#issue/1

I have the same problem, so let me paste my stacktrace:

/Users/peterakkies/Sites/phoenix/vendor/plugins/thinking_sphinx/lib/
thinking_sphinx/search.rb:94:in `method_missing'
/Users/peterakkies/Sites/phoenix/app/views/search/search.html.haml:
39:in `_run_haml_app47views47search47search46html46haml'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/action_view/
renderable.rb:34:in `send'

(etc.)

I hope you can help me figure out what's wrong.

- Peter Akkies

Pat Allan

unread,
Dec 10, 2009, 12:17:38 AM12/10/09
to thinkin...@googlegroups.com
Hi Peter

Thanks for the email - it's nice to have the validation that the error still exists. However, I can't seem to reproduce it. So, can you give me some details of your setup?

* Rails, Sphinx, Thinking Sphinx, thinking-sphinx-raspell versions
* gem config from environment.rb
* The lines of code causing the problem in your view

Cheers

--
Pat
> --
>
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
>
>

Peter Akkies

unread,
Dec 10, 2009, 9:47:00 PM12/10/09
to Thinking Sphinx
Hey Pat,

Thank you for getting back to me.

Now that you asked me for this information, I've actually decided to
try to move my application from the plugin to the gem. I'm having some
errors there, but here's the info from what I was using.

I was running Rails 2.5, Sphinx 0.9.9, Thinking Sphinx plugin (which
version... good question. Not updated in a few months.), thinking-
sphinx-raspell 1.1.0.

My gem config was as follows:

config.gem 'raspell'
config.gem 'thinking-sphinx-raspell', :lib => 'thinking_sphinx/
raspell',
:source => 'http://
gemcutter.org',
:version => '>= 1.0.0'

And my controller and view code:

@results = ThinkingSphinx.search @query,
:classes => [Journalist, Issue, Column, Piece, Page],
:page => params[:page] || 1,
:per_page => 10,
:sort_mode => :extended,
:sort_by => 'custom_model_sort ASC, ' + sort_by,
:with => (options.empty? ? '' : options)

- if @results.suggestion?
%p
= 'Did you mean "' + link_to(@results.suggestion, search_path + '?
q=' + @results.suggestion) + '"?'

Pat Allan

unread,
Dec 10, 2009, 10:29:23 PM12/10/09
to thinkin...@googlegroups.com
Hi Peter

I definitely recommend using the gem version of Thinking Sphinx - I'm not sure if plugins are loaded before gems, so there could be confusion on the part of Rails there. I can't spot anything out of place in the code you've provided.

As for issues with the gem approach, let me know and we can work through them.

--
Pat

Peter Akkies

unread,
Dec 11, 2009, 12:41:59 AM12/11/09
to Thinking Sphinx
Well, Pat, I seem to have two problems. When I comment out the spell
check code, Thinking Sphinx gives me the the following error:

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.constantize

Note that I am now using the gem; my gem config is the following:

# Thinking Sphinx and search spelling correction
config.gem 'thinking-sphinx', :lib => 'thinking_sphinx',
:version => '1.3.10'
config.gem 'raspell'
config.gem 'thinking-sphinx-raspell', :lib => 'thinking_sphinx/
raspell',
:source => 'http://
gemcutter.org',
:version => '>= 1.0.0'

When I do not comment out the spell check code, however, it is Aspell
that encounters a problem, which I suspect happens because I run Snow
Leopard. The error is the following:

dyld: lazy symbol binding failed: Symbol not found: _new_aspell_config
Referenced from: /Library/Ruby/Gems/1.8/gems/raspell-1.1/lib/
raspell.bundle
Expected in: flat namespace

dyld: Symbol not found: _new_aspell_config
Referenced from: /Library/Ruby/Gems/1.8/gems/raspell-1.1/lib/
raspell.bundle
Expected in: flat namespace

Trace/BPT trap

There is a thread on this problem here:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/1d36bd1d535fc5c1

This also shuts down my server. I don't quite know whether these are
two distinct problems or whether there is just one. In any case, when
I comment out the spell check, Thinking Sphinx should at least search,
but it does not.

Another note: I did not specify --source http://gemcutter.org when
installing the gem, but the gem installed fine anyway, which I think
is because gemcutter is already in my source list. Just letting you
know in case that might matter.

Pat Allan

unread,
Dec 12, 2009, 3:14:03 AM12/12/09
to thinkin...@googlegroups.com
Hi Peter

I think it's pretty safe to say that they're different problems...

For the aspell/raspell one, have you copied aspell across from your Leopard install? I think it's definitely worth recompiling/installing from ports/brew again, and then un- and re-installing the gem (just to be sure).

Still, even when that's sorted, I think the other error is going to come to the fore. Can you provide the full stacktrace? Also, what version of Rails are you using, and is the model in question involved in any STI or odd setup? What's the define_index block?

--
Pat

Peter Akkies

unread,
Jan 4, 2010, 9:39:45 AM1/4/10
to Thinking Sphinx
Hi Pat,

After upgrading TS to the latest version I'm not getting the TS error
anymore.

Unfortunately, I still have the aspell/raspell trouble, and I did
actually recompile it, despite earlier having completely re-installed
macports for Snow Leopard. I'm fairly sure aspell is fine now, but I'm
worried about raspell. How can I check the architecture of the raspell
gem?

> >http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/...

Pat Allan

unread,
Jan 5, 2010, 3:45:52 AM1/5/10
to thinkin...@googlegroups.com
Hi Peter

When I've installed some gems (in particular, for MySQL and PostgreSQL) on my Snow Leopard setup, I've used some flags... and so far, they've worked smoothly, so maybe they'll help. Assuming you're using the standard bash shell:

env ARCHFLAGS="-arch x86_64" gem install raspell

It's also worth uninstalling raspell completely first, then re-installing.

--
Pat

Peter Akkies

unread,
Jan 5, 2010, 12:33:41 PM1/5/10
to Thinking Sphinx
Hey Pat,

I have been using those flags all along, and that unfortunately
doesn't solve the problem. I'd like to ask the Raspell author(s) for
support, but I can't figure out where I would do that.

Pat Allan

unread,
Jan 5, 2010, 6:04:42 PM1/5/10
to thinkin...@googlegroups.com
Hi Peter

raspell is managed by Evan Weaver - you could try contacting him via GitHub:
http://github.com/evan

I know he's pretty busy, so no idea how quickly he'll respond.

--
Pat

Reply all
Reply to author
Forward
0 new messages