Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.1 compatibility? #76

Open
calebhaye opened this issue Aug 26, 2014 · 7 comments
Open

Rails 4.1 compatibility? #76

calebhaye opened this issue Aug 26, 2014 · 7 comments

Comments

@calebhaye
Copy link

Doesn't seem to work with Rails 4.1 ... tried 1.0.8 and latest

$ rails g letsrate User
  create  app/assets/javascripts/jquery.raty.js
  create  app/assets/images/star-on.png
  create  app/assets/images/star-off.png
  create  app/assets/images/star-half.png
  create  app/assets/javascripts/letsrate.js.erb
  create  app/controllers/rater_controller.rb
  create  app/models/rate.rb
  create  app/models/rating_cache.rb
   route  match '/rate' => 'rater#create', :as => 'rate'
/Users/foo/.rvm/gems/ruby-2.1.2@bar/gems/letsrate-1.0.8/lib/generators/letsrate/letsrate_generator.rb:36:in `create_migration': wrong number of arguments (3 for 0) (ArgumentError)
from /Users/foo/.rvm/gems/ruby-2.1.2@bar/gems/railties-4.1.1/lib/rails/generators/migration.rb:63:in `migration_template'
from /Users/foo/.rvm/gems/ruby-2.1.2@bar/gems/letsrate-1.0.8/lib/generators/letsrate/letsrate_generator.rb:32:in `create_cacheable_migration'
@jonathonjones
Copy link

I ran into the same issue.

As a workaround, you can just manually create the appropriate migrations and then copy and paste the code from the templates into the generated migrations.

@orbanbotond
Copy link

+1 for mer too.

/Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/letsrate-1.0.9/lib/generators/letsrate/letsrate_generator.rb:37:in create_migration': wrong number of arguments (3 for 0) (ArgumentError) from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/railties-4.1.5/lib/rails/generators/migration.rb:63:inmigration_template'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/letsrate-1.0.9/lib/generators/letsrate/letsrate_generator.rb:33:in create_cacheable_migration' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/thor-0.19.1/lib/thor/command.rb:27:inrun'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/thor-0.19.1/lib/thor/invocation.rb:133:inblock in invoke_all'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/thor-0.19.1/lib/thor/invocation.rb:133:in each' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/thor-0.19.1/lib/thor/invocation.rb:133:inmap'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/thor-0.19.1/lib/thor/invocation.rb:133:in invoke_all' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/thor-0.19.1/lib/thor/group.rb:232:indispatch'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/railties-4.1.5/lib/rails/generators.rb:157:ininvoke'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/railties-4.1.5/lib/rails/commands/generate.rb:11:in <top (required)>' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:inrequire'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in block in require' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:inload_dependency'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in require' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:135:ingenerate_or_destroy'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:51:in generate' from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:inrun_command!'
from /Users/boti/.rvm/gems/ruby-2.0.0-p353@dime/gems/railties-4.1.5/lib/rails/commands.rb:17:in <top (required)>' from ./bin/rails:4:inrequire'
from ./bin/rails:4:in `

'

@sungwoncho
Copy link

There is a folk of this gem that supports Rails 4.1.5.

@alfredayibonte
Copy link

thanks @sungwoncho

@microweb10
Copy link
Contributor

FYI
If you don't want to use another gem and make this one compatible with Rails 4. Just rename the method create_migration (line 37 in the file lib/generators/letsrate/letsrate_generator.rb) to something else.

Change this

def create_migration
  migration_template "migration.rb", "db/migrate/create_rates.rb"
end

To this

def create_rates_migration
  migration_template "migration.rb", "db/migrate/create_rates.rb"
end

@sunil-netsol
Copy link

Worked for me.

@Daham94
Copy link

Daham94 commented Apr 28, 2021

how to access this file
/Users/daham/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/nifty-generators-0.4.6/lib/generators/nifty/scaffold/scaffold_generator.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants