graphql-ruby,rails生成graphql:install不起作用

时间:2017-03-18 05:55:09

标签: ruby-on-rails ruby ruby-on-rails-4 devise graphql

当我运行rails generate graphql:install时,它会抛出错误,即使我已经安装了gemql graphql和graphql-relay。

这些是错误消息。

Running via Spring preloader in process 64355
Expected boolean default value for '--markerb'; got :erb (string)
Expected string default value for '--test-framework'; got false (boolean)
Expected string default value for '--test-framework'; got false (boolean)
Expected string default value for '--test-framework'; got false (boolean)
Expected string default value for '--helper'; got true (boolean)
Expected string default value for '--assets'; got true (boolean)
Expected string default value for '--test-framework'; got false (boolean)
Expected string default value for '--test-framework'; got false (boolean)
Expected string default value for '--test-framework'; got false (boolean)
Expected string default value for '--test-framework'; got false (boolean)
Expected string default value for '--test-framework'; got false (boolean)
Could not find generator 'graphql:install'. Maybe you meant 'react:install', 'pundit:install' or 'devise:install'
Run `rails generate --help` for more options.

Rails -v 4.2.5 Ruby -v 2.4.0

gem link

1 个答案:

答案 0 :(得分:2)

看起来这两个宝石彼此不兼容。请按照以下步骤解决此问题。

  1. gem 'graphql-relay'
  2. 中删除Gemfile
  3. bundle install
  4. 确保您拥有graphql的最新版本
    • 检查Gemfile.lock最新的graphql版本是否为1.5.2
  5. 执行生成器rails generate graphql:install
  6. 干杯