2

I am using the thumbs_up gem to create a voting system. I am using PostgreSQL. When I run:

rails generate thumbs_up

I get the following error:

/usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thumbs_up-0.6.7/lib/generators/thumbs_up/thumbs_up_generator.rb:21:in `create_migration': wrong number of arguments (3 for 0) (ArgumentError)
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/railties-4.0.4/lib/rails/generators/migration.rb:65:in `migration_template'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thumbs_up-0.6.7/lib/generators/thumbs_up/thumbs_up_generator.rb:22:in `create_migration'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/railties-4.0.4/lib/rails/generators.rb:156:in `invoke'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/railties-4.0.4/lib/rails/commands/generate.rb:11:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@firehose/gems/railties-4.0.4/lib/rails/commands.rb:48:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

How do I fix this?

1
  • I get the same error. No luck with any answer. Did you install act as votable? And what version of the gem are you using/tried? Commented May 7, 2014 at 19:46

2 Answers 2

7

This is a bug in thumbs_up.

Check this issue on github: https://github.com/bouchard/thumbs_up/issues/96

I stumbled across the same error and fixed it with the help of the link above.

Apparently all you have to do is change a file in the thumbs_up gem (you will find the location of that gem in the error itself).

In file [path to gem]/lib/generators/thumbs_up/thumbs_up_generator.rb replace

def create_migration
  migration_template 'migration.rb', File.join('db', 'migrate', 'thumbs_up_migration.rb')
end

with

def create_thumbs_up_migration
  migration_template 'migration.rb', File.join('db', 'migrate', 'thumbs_up_migration.rb')
end
3

in your Gemfile require the gem this way:

gem 'thumbs_up', git: 'https://github.com/bouchard/thumbs_up.git', ref: 'f499a7c803c0a9fdcefe4275f2f0a10ca7964508'

then run

rails generate thumbs_up 

This should work. Worked for me - hope this helps....

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.