Rails 4.1 and Thinking Sphinx - undefined method 'parent' for ActiveRecord::Associations::JoinDependency::JoinAssociation -
i started upgrade rails 4.0
app rails 4.1
. app uses lot of gems , thinking sphinx 1 of them. have reinstalled thinking-sphinx gem after rails 4.1 upgrade (to enable proper version of joiner, 3.0
now). weird error ts when try, example, rebuild index:
$ rake ts:rebuild --trace ** invoke ts:rebuild (first_time) ** invoke ts:stop (first_time) ** invoke environment (first_time) ** execute environment ** execute ts:stop searchd not running. stopped searchd daemon (pid: ). ** invoke ts:index (first_time) ** invoke environment ** execute ts:index generating configuration /users/serj/projects/project/config/development.sphinx.conf rake aborted! nomethoderror: undefined method `parent' #<activerecord::associations::joindependency::joinassociation:0x007ff438543678> /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/filtered_reflection.rb:40:in `block in scope' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:52:in `instance_exec' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:52:in `block (2 levels) in join_constraints' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:48:in `map' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:48:in `block in join_constraints' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:33:in `reverse_each' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:33:in `join_constraints' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:161:in `make_constraints' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:167:in `make_outer_joins' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:169:in `block in make_outer_joins' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:169:in `each' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:169:in `flat_map' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:169:in `make_outer_joins' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:205:in `block in walk' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:205:in `each' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:205:in `flat_map' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:205:in `walk' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:114:in `block in join_constraints' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:112:in `each' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:112:in `flat_map' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:112:in `join_constraints' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/relation/query_methods.rb:985:in `build_joins' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/relation/query_methods.rb:838:in `build_arel' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/relation/query_methods.rb:830:in `arel' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activerecord-4.1.1/lib/active_record/relation.rb:520:in `to_sql' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/sql_builder.rb:11:in `sql_query' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/sql_source.rb:119:in `build_sql_query' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/sql_source.rb:136:in `prepare_for_render' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/sql_source.rb:65:in `render' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/riddle-1.5.11/lib/riddle/configuration/index.rb:29:in `block in render' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/riddle-1.5.11/lib/riddle/configuration/index.rb:29:in `collect' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/riddle-1.5.11/lib/riddle/configuration/index.rb:29:in `render' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/core/index.rb:53:in `render' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/riddle-1.5.11/lib/riddle/configuration.rb:43:in `block in render' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/riddle-1.5.11/lib/riddle/configuration.rb:43:in `collect' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/riddle-1.5.11/lib/riddle/configuration.rb:43:in `render' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/configuration.rb:90:in `render' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/configuration.rb:96:in `block in render_to_file' /users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/open-uri.rb:36:in `open' /users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/open-uri.rb:36:in `open' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/configuration.rb:96:in `render_to_file' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/rake_interface.rb:13:in `configure' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/rake_interface.rb:24:in `index' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/tasks.rb:9:in `block (2 levels) in <top (required)>' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:240:in `call' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:235:in `each' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain' /users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:201:in `block in invoke_prerequisites' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:199:in `each' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:199:in `invoke_prerequisites' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:178:in `block in invoke_with_call_chain' /users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:106:in `each' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/lib/rake/application.rb:75:in `run' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/rake-10.3.2/bin/rake:33:in `<top (required)>' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/bin/rake:23:in `load' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/bin/rake:23:in `<main>' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/bin/ruby_executable_hooks:15:in `eval' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/bin/ruby_executable_hooks:15:in `<main>' tasks: top => ts:rebuild => ts:index
gemfile
source 'http://rubygems.org' gem 'rails', '4.1.0' # sphinx. gem 'mysql2', '0.3.13', platform: :ruby gem 'thinking-sphinx', '~> 3.1.1' # ...
thinking_sphinx.yml
development: &defaults morphology: stem_enru, soundex, metaphone enable_star: 1 expand_keywords: 1 min_infix_len: 2 max_matches: 500000 test: mysql41: <%= env['test_env_number'].to_i + 9307 %> pid_file: <%= file.join(rails.root, "tmp", "searchd.#{env['test_env_number']}.pid") %> indices_location: <%= file.join(rails.root, "db", "sphinx", "#{env['test_env_number']}") %> configuration_file: <%= file.join(rails.root, "config", "test.#{env['test_env_number']}.sphinx.conf") %> binlog_path: <%= file.join(rails.root, "db", "sphinx", "#{env['test_env_number']}", "binlog") %> <<: *defaults
additional data:
- rails 4.1
- sphinx 2.1.4-release (rel21-r4421)
- thinking-sphinx 3.1.1
- mysql2 0.3.16 (for sphinx)
- pg 0.17.1 (it's main database)
any ideas how deal that? can't make upgrade new rails, because project uses ts heavy.
okey, there problem thinking sphinx , rails 4.1. polymorphic associations broken in thinking sphinx, when use rails 4.1 (because, well, lot of things changed in activerecord). here issue, opened: https://github.com/pat/thinking-sphinx/issues/783
in case moved polymorphic association, because wanted able upgrade rails 4.1.
upd: pat fixed issue, should work now.
Comments
Post a Comment