Skip to content

Instantly share code, notes, and snippets.

@mfifth
Last active January 20, 2017 05:26
Show Gist options
  • Save mfifth/e5b137710412eba16b655d09ee2d912e to your computer and use it in GitHub Desktop.
Save mfifth/e5b137710412eba16b655d09ee2d912e to your computer and use it in GitHub Desktop.
matt@matt-HP-Notebook:~/RubyProjects/replay$ rails s
=> Booting Puma
=> Rails 5.0.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/home/matt/.gem/ruby/2.3.0/gems/sunspot_rails-2.2.7/lib/sunspot/rails/searchable.rb:92:in `searchable': undefined method `before_save' for Feedjira::Feed:Class (NoMethodError)
from /home/matt/RubyProjects/replay/config/initializers/feedjira.rb:8:in `<class:Feed>'
from /home/matt/RubyProjects/replay/config/initializers/feedjira.rb:5:in `<top (required)>'
from /home/matt/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /home/matt/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load'
from /home/matt/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /home/matt/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:648:in `block in load_config_initializer'
from /home/matt/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in `instrument'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:647:in `load_config_initializer'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:611:in `each'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:611:in `block in <class:Engine>'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:44:in `each'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
from /home/matt/RubyProjects/replay/config/environment.rb:5:in `<top (required)>'
from /home/matt/RubyProjects/replay/config.ru:3:in `require_relative'
from /home/matt/RubyProjects/replay/config.ru:3:in `block in <main>'
from /home/matt/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from /home/matt/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
from /home/matt/RubyProjects/replay/config.ru:in `new'
from /home/matt/RubyProjects/replay/config.ru:in `<main>'
from /home/matt/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from /home/matt/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from /home/matt/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
from /home/matt/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /home/matt/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:59:in `app'
from /home/matt/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:77:in `start'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/matt/.gem/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /home/matt/RubyProjects/replay/bin/rails:9:in `require'
from /home/matt/RubyProjects/replay/bin/rails:9:in `<top (required)>'
from /home/matt/.gem/ruby/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
from /home/matt/.gem/ruby/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
from /home/matt/.gem/ruby/2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
from /home/matt/.gem/ruby/2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
from /home/matt/.gem/ruby/2.3.0/gems/spring-1.7.2/bin/spring:49:in `<top (required)>'
from /home/matt/.gem/ruby/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
from /home/matt/.gem/ruby/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/matt/.rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/matt/RubyProjects/replay/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
matt@matt-HP-Notebook:~/RubyProjects/replay$
require 'sunspot'
require 'sunspot/rails'
require 'feedjira/feed'
module Feedjira
def self.included(base)
base.class_eval do
extend Sunspot::Rails::Searchable::ActsAsMethods
Sunspot::Adapters::DataAccessor.register(EntryAccessor, base)
Sunspot::Adapters::InstanceAdapters.register(EntryAdapters, base)
def self.before_save(*)
end
def self.after_save(*)
end
def self.after_destroy(*)
end
searchable do
text :url
text :title
end
end
end
class EntryAccessor < Sunspot::Adapters::InstanceAdapters
def id
self.entry.id
end
end
class EntryAdapters < Sunsport::Adapters::DataAccessor
def load_all(ids)
entries.select {|entry| ids.include?(entry.id)}
end
def load(id)
entries[id]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment