Ruby on rails 轨道抛出';load_missing_常量:预期路径_到_x以定义x';,但事实确实如此
我的错误:Ruby on rails 轨道抛出';load_missing_常量:预期路径_到_x以定义x';,但事实确实如此,ruby-on-rails,ruby,ruby-on-rails-3,Ruby On Rails,Ruby,Ruby On Rails 3,我的错误: /Users/-/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:512:in `load_missing_constant': Unable to autoload constant Types::QueryType, expected /Users/-/project/app/graph/types/query_type.rb to define it (Loa
/Users/-/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:512:in `load_missing_constant':
Unable to autoload constant Types::QueryType, expected /Users/-/project/app/graph/types/query_type.rb to define it (LoadError)
app/graph/schema.rb:
module Graph
Schema = GraphQL::Schema.define do
query Types::QueryType
end
end
app/graph/types/query_type.rb:
module Graph
module Types
QueryType = GraphQL::ObjectType.define do
name 'Query'
end
end
end
config/application.rb:
config.autoload_paths << "#{Rails.root}/app/graph"
config.autoload_paths << "#{Rails.root}/app/graph/interfaces"
config.autoload_paths << "#{Rails.root}/app/graph/types"
config.autoload_paths << "#{Rails.root}/app/graph/unions"
config.autoload\u路径