The Wayback Machine - https://web.archive.org/web/20210106155311/https://github.com/ruby-grape/grape/issues/1939
Skip to content
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 Grape::Middleware::Base::Helpers after update to 1.2.5 #1939

Open
seb-sykio opened this issue Dec 3, 2019 · 6 comments
Open
Labels

Comments

@seb-sykio
Copy link

@seb-sykio seb-sykio commented Dec 3, 2019

/.rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/middleware/base.rb:6:in `<class:Base>': uninitialized constant Grape::Middleware::Base::Helpers (NameError)
	from .rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/middleware/base.rb:5:in `<module:Middleware>'
	from .rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/middleware/base.rb:4:in `<module:Grape>'
	from .rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/middleware/base.rb:3:in `<top (required)>'
	from .rvm/gems/ruby-2.6.5/gems/grape_logging-1.8.3/lib/grape_logging/middleware/request_logger.rb:1:in `<top (required)>'

@dblock dblock added the bug? label Dec 4, 2019
@dblock
Copy link
Member

@dblock dblock commented Dec 4, 2019

That's not good. You got a project up that reproduces this? Or bisect it to a change?

@seb-sykio
Copy link
Author

@seb-sykio seb-sykio commented Jan 7, 2020

sorry, nothing online.
the only solution I found for now is to remove gem "grape-logging"

@robert-hromej
Copy link

@robert-hromej robert-hromej commented Jan 16, 2020

@dblock @seb-sykio try require 'grape' before require 'grape_logging'

@dblock
Copy link
Member

@dblock dblock commented Jan 16, 2020

If this fixes that feels like grape_logging should be doing a require 'grape'. Open an issue in that repo.

@myxoh
Copy link
Member

@myxoh myxoh commented Feb 3, 2020

Any updates?

costis added a commit to reevoo/sapience-rb that referenced this issue Feb 16, 2020
costis added a commit to reevoo/sapience-rb that referenced this issue Feb 17, 2020
CI build has been broken for a long time. It is time to fix this.
The build was broken because latest version of rubygems

  * Use a 'minimal' VM to avoid issues with ruby, bundler 2.0 and the
    fact that we don't use a Gemfile.lock to force the use of bundler
    1.x. It is messy. I spent too much time trying to fix. It is better
      to avoid all this for now and re-enable later if we need it.
  * Run reevoocop with docker-compose.
  * Disable posting code coverage results to CodeClimate. This is
    temporary, until we re-enable ruby/bundler.
  * Remove slack notifications. We have moved to horrible and develope
    unfriendly  MS Teams.
  * Pin postgres to v9. There is an issue with rails 4.x and pg > 9.
  * Fix issue with missing 'require' introduced in grape > 1.25.
    See ruby-grape/grape#1939
  * Use latest version of rails 4.x
  * Other minor fixes that I failed to record.
@pboling
Copy link

@pboling pboling commented Mar 25, 2020

CC @myxoh

@robert-hromej had the right idea.

If I move require 'grape_logging' to spot in the load order after I am sure grape has been loaded, then this error goes away. This gem, as is, doesn't load grape properly on it's own, but allowing bundler to load grape works.

In other words, if I have a require 'grape_logging' early on, before bundler loads my environment, then I get this error with latest version of grape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.