ronzalo / spree_searchkick

Add Elasticsearch goodies to Spree, powered by searchkick
BSD 3-Clause "New" or "Revised" License
31 stars 57 forks source link

method_missing: undefined method searchkick #3

Closed Wooobee closed 9 years ago

Wooobee commented 9 years ago

Hi,

I tried to add Searchkick to my existing Spree 3 Stable project. While running: bundle exec rails g spree_searchkick:install I got the error: gems/ruby-2.1.2/gems/activerecord-4.2.2/lib/active_record/dynamic_matchers.rb:26:in 'method_missing': undefined method 'searchkick' for #<Class:0x007fe79db37720> (NoMethodError)

So I tested it with a clean new installation of Spree 3-0-stable just to test out if it works but I still get the sam error.

Here is the extract:

/Users/Manu/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.2/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `searchkick' for #<Class:0x007fe79db37720> (NoMethodError)
    from /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_searchkick-563113c2d506/app/models/spree/product_decorator.rb:2:in `block in <top (required)>'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_searchkick-563113c2d506/app/models/spree/product_decorator.rb:1:in `class_eval'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_searchkick-563113c2d506/app/models/spree/product_decorator.rb:1:in `<top (required)>'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `block in load'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_searchkick-563113c2d506/lib/spree_searchkick/engine.rb:16:in `block in activate'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_searchkick-563113c2d506/lib/spree_searchkick/engine.rb:15:in `glob'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_searchkick-563113c2d506/lib/spree_searchkick/engine.rb:15:in `activate'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:446:in `instance_exec'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:446:in `block in make_lambda'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:192:in `call'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:192:in `block in simple'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:504:in `call'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:504:in `block in call'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:504:in `each'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:504:in `call'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:92:in `_run_callbacks'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:776:in `_run_prepare_callbacks'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.2/lib/action_dispatch/middleware/reloader.rb:83:in `prepare!'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.2/lib/action_dispatch/middleware/reloader.rb:55:in `prepare!'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/application/finisher.rb:50:in `block in <module:Finisher>'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `run'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/application.rb:352:in `initialize!'
    from /Users/Manu/Documents/rails_projects/store_v4/config/environment.rb:5:in `<top (required)>'
    from /Users/Manu/.rvm/gems/ruby-2.1.2@global/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
    from /Users/Manu/.rvm/gems/ruby-2.1.2@global/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `block in require'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/spring-1.4.0/lib/spring/application.rb:92:in `preload'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/spring-1.4.0/lib/spring/application.rb:143:in `serve'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/spring-1.4.0/lib/spring/application.rb:131:in `block in run'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/spring-1.4.0/lib/spring/application.rb:125:in `loop'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/spring-1.4.0/lib/spring/application.rb:125:in `run'
    from /Users/Manu/.rvm/gems/ruby-2.1.2/gems/spring-1.4.0/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Manu/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'

Can someone help? Many thanks!

Best Manuel

Wooobee commented 9 years ago

Found my mistake. Have to add `gem 'searchkick'``

Maybe add this in the description.

Best Manuel

ronzalo commented 9 years ago

Weird, searchkick is added as dependency in gemspec and included in Gemfile, btw, README.md updated.

Thanks @Wooobee