锦标赛系统创建驱动程序



现在错误已通过添加require 'tournament_system'修复了,这是我的新错误:

这是终端:

  Rendering html template
  Rendered html template (0.0ms)
  Rendered tourneys/index.html.erb within layouts/application (10.8ms)
Completed 401 Unauthorized in 16ms (Views: 0.3ms | ActiveRecord: 1.1ms)

RuntimeError - Not Implemented:
  app/controllers/tourneys_controller.rb:77:in `tourn'
  app/views/tourneys/index.html.erb:37:in `_app_views_tourneys_index_html_erb__1482772099755741577_70314301318160'
Started POST "/__better_errors/deabb75178ea93ac/variables" for ::1 at 2018-04-17 00:55:03 -0700

这是在网页上

Not Implemented
tournapp/controllers/tourneys_controller.rb
72
73
74
75
76
77
78
79
80
81
82
  def tourn
    driver = Driver.new
   # Generate a round of a single elimination tournament
    TournamentSystem::SingleElimination.generate driver
    #Challonge::Tournament.find(:all)
    #@teamArray2 = render html: "<div>#{Challonge::Tournament.find(:all)}</div>".html_safe
  end
>>
 This is a live shell. Type in here.
Request info
Request parameters  
{"controller"=>"tourneys", "action"=>"index"}
Rack session    
(object too large. Modify ActionDispatch::Request::Session#inspect or increase BetterErrors.maximum_variable_inspect_size)
Local Variables
driver  
#<Driver:0x00007fe6a4eba5e0>

我相信错误与未正确调用驱动程序有关。我还使用脚手架创建了控制器Tourney。

您的Class Driver是固有的TournamentSystem::Driver,但该模块不可用,因为它不是明确需要的。

添加require 'tournament_system'应该可以解决这个问题。


关于NotImplemented错误,这与您的代码无关。如果您遵循module SingleEliminationdef generate的源代码(源代码(并遍历:

def 生成调用create_matches调用create_match最终调用build_match并且具有raise 'Not Implemented'

项目的开发人员尚未完成所有必需功能的实现。

最新更新