Skip to content

Instantly share code, notes, and snippets.

@etdebruin
Last active August 29, 2015 14:02
Show Gist options
  • Save etdebruin/02aa94beb010a14cba97 to your computer and use it in GitHub Desktop.
Save etdebruin/02aa94beb010a14cba97 to your computer and use it in GitHub Desktop.
reindex
musolist@musolist:/mnt/musolist/current$ bundle exec rails c
Loading production environment (Rails 4.0.5)
irb(main):001:0> Song.reconfigure_search_index
=> #<Hashie::Mash acknowledged=true ok=true>
irb(main):002:0> Song.reindex_all
NoMethodError: undefined method `fields' for nil:NilClass
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/mysql2_adapter.rb:227:in `exec_query'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/mysql2_adapter.rb:235:in `select'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/querying.rb:36:in `find_by_sql'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/relation.rb:585:in `exec_queries'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/association_relation.rb:15:in `exec_queries'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/relation.rb:471:in `load'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/relation.rb:220:in `to_a'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/relation/finder_methods.rb:316:in `find_take'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/relation/finder_methods.rb:66:in `take'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/associations/singular_association.rb:42:in `find_target'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/associations/association.rb:147:in `load_target'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/associations/association.rb:54:in `reload'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/associations/singular_association.rb:9:in `reader'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/associations/builder/association.rb:70:in `city'
... 1 levels...
from /mnt/musolist/releases/20140612210747/app/search/search/indexes/abstract_index.rb:37:in `add'
from /mnt/musolist/releases/20140612210747/app/models/concerns/searchable.rb:37:in `add_to_search_index'
from /mnt/musolist/releases/20140612210747/app/models/concerns/searchable.rb:28:in `block in reindex_all'
from /mnt/musolist/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.5/lib/active_record/relation/batches.rb:26:in `block (2 levels) i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment