-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uninitialized constant GraphiQL::Rails::EditorsController #43
Comments
Hi, sorry to hear about that error! I'm really not sure what to say, and I agree that it's strange that the other constants would load properly but not It looks like the last CI run used Rails 5.1.5: https://travis-ci.org/rmosolgo/graphiql-rails/jobs/351319980#L1275 So I would expect 5.1.6 to work just fine! Are you able to replicate the issue on a newly-created rails 5.1.6 application? |
I've created a new project with only the basic and it works like a charm. But in my project it doesn't. source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# API
gem 'graphql', '1.7.4'
gem 'graphiql-rails', '1.4.4', group: :development
#gem 'search_object', '1.2.0'
#gem 'search_object_graphql', '0.1'
gem 'dry-struct'
gem 'rest-client'
gem 'alegra'
# upload files
gem 'fog-aws'
gem 'carrierwave'
gem 'mini_magick'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'annotate'
gem 'figaro'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.1.6'
# Use sqlite3 as the database for Active Record
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
group :development, :test do
# Adds support for Capybara system testing and selenium driver
gem 'spirit_hands'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'rubocop', '~> 0.36.0', require: false
gem 'guard-rubocop', '~> 1.2.0'
gem 'rubycritic', '~> 2.7.0', require: false
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
#gem 'spring'
#gem 'spring-watcher-listen', '~> 2.0.0'
#gem 'rerun'
end
group :test do
gem 'vcr'
gem 'webmock'
gem 'database_cleaner'
end is it possible that another gem is causing this error? any other idea? |
Could you share the full error and stack trace? Could you share these two arrays:
The gem's paths should be in that list. Is your app "API-only" mode? There are some issues with that, too: #13 But they seem slightly different. |
No it not "API-only"... I gonna review them and see if they have a fix for it. |
Huh! the gem paths are there. That's good. can you share the full error and stack trace? |
Use Ctrl-C to stop
Started GET "/graphiql" for 127.0.0.1 at 2018-04-12 15:52:06 -0500
(1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
ActionController::RoutingError (uninitialized constant GraphiQL::Rails::EditorsController):
activesupport (5.1.6) lib/active_support/inflector/methods.rb:271:in `const_get'
activesupport (5.1.6) lib/active_support/inflector/methods.rb:271:in `block in constantize'
activesupport (5.1.6) lib/active_support/inflector/methods.rb:267:in `each'
activesupport (5.1.6) lib/active_support/inflector/methods.rb:267:in `inject'
activesupport (5.1.6) lib/active_support/inflector/methods.rb:267:in `constantize'
actionpack (5.1.6) lib/action_dispatch/http/request.rb:85:in `controller_class_for'
actionpack (5.1.6) lib/action_dispatch/http/request.rb:78:in `controller_class'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:43:in `controller'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:29:in `serve'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call'
railties (5.1.6) lib/rails/engine.rb:522:in `call'
railties (5.1.6) lib/rails/railtie.rb:185:in `public_send'
railties (5.1.6) lib/rails/railtie.rb:185:in `method_missing'
actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:17:in `block in <class:Constraints>'
actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:46:in `serve'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call'
rack (2.0.4) lib/rack/etag.rb:25:in `call'
rack (2.0.4) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.4) lib/rack/head.rb:12:in `call'
rack (2.0.4) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.4) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.6) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.6) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.6.0) lib/web_console/middleware.rb:137:in `call_app'
web-console (3.6.0) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.6.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.6.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.6) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.6) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.6) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.4) lib/rack/method_override.rb:22:in `call'
rack (2.0.4) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.4) lib/rack/sendfile.rb:111:in `call'
railties (5.1.6) lib/rails/engine.rb:522:in `call'
puma (3.11.4) lib/puma/configuration.rb:225:in `call'
puma (3.11.4) lib/puma/server.rb:632:in `handle_request'
puma (3.11.4) lib/puma/server.rb:446:in `process_client'
puma (3.11.4) lib/puma/server.rb:306:in `block in run'
puma (3.11.4) lib/puma/thread_pool.rb:120:in `block in spawn_thread' |
It looks right to me :'( The backtrace, does, I mean. But why doesn't that call to |
Just want to mention I'm seeing this too, I've tried different versions as well. We're on ruby 2.3.6 and rails 4.2. I was hoping to find some similarities in the Gemfile with @degzcs but there doesn't seem to be anything too obvious there (we have a large Gemfile, happy to share if that would help). Stack trace looks similar:
The same thing occurred when I disabled the bootsnap gem as well so I think those first lines from the stack trace are irrellevant |
I also get this error using
on Rails 5.2.0 |
I'm seeing it as well.
Rails 5.2.0 |
FWIW I was able to track it down to a conflict with an old version of |
same here |
I also bumped into this error, but only in staging environment. The reason was that I added the gem to |
Hello! I tried to integrate this gem into existing Rails(not
UPD: (bad solution) FYI, I hardcoded requiring of def show
render file: 'graphiql/rails/editors/show'
end rails.rb: require "rails"
if ActiveSupport::Inflector.method(:inflections).arity == 0
# Rails 3 does not take a language in inflections.
ActiveSupport::Inflector.inflections do |inflect|
inflect.acronym("GraphiQL")
end
else
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym("GraphiQL")
end
end
require "graphiql/rails/config"
require "graphiql/rails/engine"
require "graphiql/rails/version"
require_relative "../../app/controllers/graphiql/rails/editors_controller"
module GraphiQL
module Rails
class << self
attr_accessor :config
end
self.config = Config.new
end
end |
@degzcs #41 (comment) this solve your problem. `group :development do gem 'graphiql-rails' end` |
same problem here, so far I didn't found any solution |
Same problem here, finally figured that another gem I was including was overwriting the |
I ran into this issue after upgrading to Rails 6. I was able to resolve it by adding
|
@drizlyben Same issue here! Caused by the method |
Hey everyone, thanks for sharing what you found here. I'm going to close this issue since it hasn't been updated in almost three years. If anyone runs into this trouble again, please open a new issue. For reference, here's where this library registers graphiql-rails/lib/graphiql/rails.rb Lines 3 to 12 in e928e70
And that's still the recommended way to specify custom inflections (https://guides.rubyonrails.org/v7.1/autoloading_and_reloading_constants.html#customizing-inflections), but if you have other customizations, you may have to register |
Hi,
I'm getting this error when try to access to
http://localhost:3000/graphiql
uninitialized constant GraphiQL::Rails::EditorsController
I've already installed graphql and graphiql gems
NOTE: I already try with 'graphiql-rails', '1.4.4' and it didn't work
The weird thing is that the classes
Config Engine VERSION
have been loaded by not the EditorsController.Seems that the problem is how the gem is requiring the rails embedded app.
I really appreciate your support to fix this issue.
Thanks
The text was updated successfully, but these errors were encountered: