2

虽然我试图创建一个脚手架 rails g nifty:scaffold authentication user_id:integer provider:string uid:string index create destroy

authentication.rb 已生成但没有视图我收到错误为 /home/user/.rvm/gems/ruby-2.1.0/gems/nifty-generators-0.4.6/lib/generators/nifty/scaffold/scaffold_generator.rb :85:in create_migration': wrong number of arguments (3 for 0) (ArgumentError) from /home/user/.rvm/gems/ruby-2.1.0/gems/railties-4.1.2.rc1/lib/rails/generators/migration.rb:63:inmigration_template' 来自 /home/user/.rvm/gems/ruby-2.1.0/gems/nifty-generators-0.4.6/lib/generators/nifty/scaffold/scaffold_generator.rb:87:in create_migration' from /home/user/.rvm/gems/ruby-2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:inrun'来自 /home/user/.rvm/gems/ruby-2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /home/user/.rvm/gems/ruby-2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in块 in invoke_all' 来自 /home/user/.rvm/gems /ruby-2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in each' from /home/user/.rvm/gems/ruby-2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:inmap' 来自 /home/user/.rvm/gems/ruby-2.1.0/gems/thor-0.19 .1/lib/thor/invocation.rb:133:ininvoke_all' from /home/user/.rvm/gems/ruby-2.1.0/gems/thor-0.19.1/lib/thor/group.rb:232:in dispatch' 来自 /home/user/.rvm/gems/ruby-2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440 :在start' from /home/user/.rvm/gems/ruby-2.1.0/gems/railties-4.1.2.rc1/lib/rails/generators.rb:157:in从 /home/user/.rvm/gems/ruby-2.1.0/gems/railties-4.1.2.rc1/lib/rails/commands/generate.rb:11:in 调用'来自 /home/user/.rvm/gems /ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:247:in<top (required)>' from /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:247:in需要'来自 /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:247:in block in require' from /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:232:inload_dependency' 来自 /home/user/.rvm /gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:247:in require' from /home/user/.rvm/gems/ruby-2.1.0/gems/railties-4.1.2.rc1/lib/rails/commands/commands_tasks.rb:135:ingenerate_or_destroy' 来自 /home/user/.rvm/gems/ruby-2.1.0/gems /railties-4.1.2.rc1/lib/rails/commands/commands_tasks.rb:51:in generate' from /home/user/.rvm/gems/ruby-2.1.0/gems/railties-4.1.2.rc1/lib/rails/commands/commands_tasks.rb:40:inrun_command!来自 /home/user/.rvm/gems/ruby-2.1.0/gems/railties-4.1.2.rc1/lib/rails/commands.rb:17:in load_dependency' 来自 /home/user/.rvm/gems /ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:247:in '来自 /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport- 4.1.2.rc1/lib/active_support/dependencies.rb:241:in<top (required)>' from /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:247:inblock in require' from /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:232:inrequire' from /home/user/Desktop/remake/bin/rails:8:inload' from /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:241:in阻止来自 /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:232:in load_dependency' from /home/user/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.2.rc1/lib/active_support/dependencies.rb:241:inload' 来自 /home/user/ .rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from -e:1:in `'

4

1 回答 1

3

Nifty generators havn't been updated since oct 2012 (from the github page). Use something different, because this gem is definitely not up-to-date.

于 2014-06-20T10:08:34.813 回答