Does anyone know any useful gem to create voting system in Sinatra? : <p>Hi I am creating a small Sinatra app and trying to create a voting system in it.</p>

<p>I tried using acts_as_votable gem but it is giving me some error.</p>

<pre><code>rake db:migrate                                                                                                                                  
rake aborted!                                                                                                                                         
TypeError: ActsAsVotable is not a class
</code></pre>

<p>Here is my migration file which I tried to make from source code of gem.
class ActsAsVotable &lt; ActiveRecord::Migration[5.1]
  def self.up
    create_table :votes do |t|</p>

<pre><code>  t.references :votable, :polymorphic =&gt; true
  t.references :voter, :polymorphic =&gt; true

  t.boolean :vote_flag
  t.string :vote_scope
  t.integer :vote_weight

  t.timestamps
end

if ActiveRecord::VERSION::MAJOR &lt; 4
  add_index :votes, [:votable_id, :votable_type]
  add_index :votes, [:voter_id, :voter_type]
end

add_index :votes, [:voter_id, :voter_type, :vote_scope]
add_index :votes, [:votable_id, :votable_type, :vote_scope]


end

  def self.down
    drop_table :votes
  end
end
</code></pre>

<p>I also created Acts_as_votable module from the gem source code. Please see below code</p>

<pre><code>require 'active_record'
require 'active_support/inflector'

$LOAD_PATH.unshift(File.dirname(__FILE__))

module ActsAsVotable

  if defined?(ActiveRecord::Base)
    require 'acts_as_votable/extenders/votable'
    require 'acts_as_votable/extenders/voter'
    require 'acts_as_votable/vote'
    ActiveRecord::Base.extend ActsAsVotable::Extenders::Votable
    ActiveRecord::Base.extend ActsAsVotable::Extenders::Voter
  end

end

require 'acts_as_votable/extenders/controller'
ActiveSupport.on_load(:action_controller) do
  include ActsAsVotable::Extenders::Controller
end
</code></pre>

<p>Any suggestion to make this work or any other alternet solution for Sinatra?</p>
