使用apitome进行未初始化的常量RspecApiDocumentation

时间:2017-11-21 21:54:44

标签: ruby-on-rails rspec-api-documentation apitome

当跟随instructions设置aptitome和rspec_api_documentation时,我收到以下错误:

uninitialized constant RspecApiDocumentation

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我通过从spec_helper.rb删除配置并根据此blog设置初始化程序来解决它,即

# config/initializers/rspec_api_documentation.rb
RspecApiDocumentation.configure do |config|
  # Output folder
  config.docs_dir = Rails.root.join("doc", "api")

  # An array of output format(s).
  # Possible values are :json, :html, :combined_text, :combined_json,
  #   :json_iodocs, :textile, :markdown, :append_json
  config.format = [:json]
end