使用命令“Rails g controller”时出错

时间:2017-03-09 08:04:43

标签: ruby-on-rails-4

帮助,我不明白这个rails错误。

我根据bundler的bundle install命令使用最新的rails。

我正在使用Windows 7.

当我运行命令C:/Users/Owner/ruby_intro/graded-assignments/recipefinder/config/initializers/ne w_framework_defaults.rb:21:in `<top (required)>': undefined method `halt_callbac k_chains_on_return_false=' for ActiveSupport:Module (NoMethodError) from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport- 4.2.8/lib/active_support/dependencies.rb:268:in `load' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport- 4.2.8/lib/active_support/dependencies.rb:268:in `block in load' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport- 4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport- 4.2.8/lib/active_support/dependencies.rb:268:in `load' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/engine.rb:652:in `block in load_config_initializer' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport- 4.2.8/lib/active_support/notifications.rb:166:in `instrument' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/engine.rb:651:in `load_config_initializer' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/engine.rb:615:in `each' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/engine.rb:615:in `block in <class:Engine>' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/initializable.rb:30:in `instance_exec' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/initializable.rb:30:in `run' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/initializable.rb:55:in `block in run_initializers' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block i n tsort_each' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block ( 2 levels) in each_strongly_connected_component' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:422:in `block ( 2 levels) in each_strongly_connected_component_from' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_st rongly_connected_component_from' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:421:in `block i n each_strongly_connected_component_from' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/initializable.rb:44:in `each' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/initializable.rb:44:in `tsort_each_child' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:415:in `call' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:415:in `each_st rongly_connected_component_from' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block i n each_strongly_connected_component' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_st rongly_connected_component' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_e ach' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_e ach' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/initializable.rb:54:in `run_initializers' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/application.rb:352:in `initialize!' from C:/Users/Owner/ruby_intro/graded-assignments/recipefinder/config/en vironment.rb:5:in `<top (required)>' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/application.rb:328:in `require' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/application.rb:328:in `require_environment!' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/commands/commands_tasks.rb:142:in `require_application_and_environmen t!' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/commands/commands_tasks.rb:50:in `generate' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/commands/commands_tasks.rb:39:in `run_command!' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.8 /lib/rails/commands.rb:17:in `<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>' 时,它会显示如下错误消息:

var result = (from t in TrnExpense 
group t by new { t.CreatedOn.Date, t.Note } into g
orderby g.Key.Date descending
select new{
    CreatedOn = g.Key.Date,
    Note = g.Key.Note,
    Count = g.Count()
}).ToList();

有人可以帮忙吗?

谢谢你,请原谅我英语不好。

0 个答案:

没有答案