Hi Melody,

There was a couple of commits related to fixing alternative primary keys that 
are part of v3.3.0 - I realise if you’re not familiar with this gem or Sphinx 
it could be daunting, but I’d recommend upgrading if at all possible.

The release notes for v3.2.0 and v3.3.0 (the only releases since v3.1.4) cover 
off notable changes - I’d say there’s a good chance you won’t hit any issues 
though:
https://github.com/pat/thinking-sphinx/releases/tag/v3.2.0 
<https://github.com/pat/thinking-sphinx/releases/tag/v3.2.0>
https://github.com/pat/thinking-sphinx/releases/tag/v3.3.0 
<https://github.com/pat/thinking-sphinx/releases/tag/v3.3.0>

If the error (or something like it) is still happening on v3.3.0, do let me 
know!

Cheers,

— 
Pat

> On 19 Jul 2017, at 8:10 am, Melody B <mel...@sassafras.coop 
> <mailto:mel...@sassafras.coop>> wrote:
> 
> I'm getting an error on configure:
> 
> Generating configuration to ~/myapp/config/development.sphinx.conf
> rake aborted!
> NoMethodError: undefined method `<<' for nil:NilClass
> ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:96:in
>  `block in append_presenter_to_attribute_array'
> ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:93:in
>  `each'
> ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:93:in
>  `append_presenter_to_attribute_array'
> ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:131:in
>  `prepare_for_render'
> ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:65:in
>  `render'
> 
> I have a few weird things going on in my setup that are (probably?) having an 
> impact.
> My database is postgres has uuid primary keys
> I defined a custom field that generates a bigint in a before_create callback 
> called secondary_id -- this seemed like the best way to provide sphinx with 
> something it could index on but if this is the wrong way to go about keeping 
> my uuid primary keys i'm open to alternative suggestions
> I set secondary_id as the primary key for sphinx in the index definition with 
> the following code:
> ThinkingSphinx::Index.define :answer, with: :active_record, primary_key: 
> :proxy_id do ... end
> I'm honestly not sure what's going on here -- I tried poking around in the 
> code to sort out why this was happening and I tried guarding for nil on that 
> line allows configuring to finish, but it predictably continues to explode 
> during actual operation when I create a new instance of :answer -- I knew 
> that was a longshot, but any help would be appreciated. I'm not particularly 
> experienced with sphinx or thinking-sphinx, I inherited this project after it 
> was already in place (the move to uuid primary keys is fairly recent, and 
> this is the last major blocker) so just let me know if you need any 
> additional info or context.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to thinking-sphinx+unsubscr...@googlegroups.com 
> <mailto:thinking-sphinx+unsubscr...@googlegroups.com>.
> To post to this group, send email to thinking-sphinx@googlegroups.com 
> <mailto:thinking-sphinx@googlegroups.com>.
> Visit this group at https://groups.google.com/group/thinking-sphinx 
> <https://groups.google.com/group/thinking-sphinx>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to thinking-sphinx+unsubscr...@googlegroups.com.
To post to this group, send email to thinking-sphinx@googlegroups.com.
Visit this group at https://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to