Open calebhaye opened 10 years ago
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.
+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:in
migration_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:in
run'
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:in
block 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:in
map'
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:in
dispatch'
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:in
invoke'
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:in
require'
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:in
load_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:in
generate_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:in
run_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:in
require'
from ./bin/rails:4:in `
There is a folk of this gem that supports Rails 4.1.5.
thanks @sungwoncho
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
Worked for me.
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
Doesn't seem to work with Rails 4.1 ... tried 1.0.8 and latest