ridiculous / grape-middleware-logger

Logging middleware for Grape apps
MIT License
53 stars 32 forks source link

Added instructions for requiring the gem #18

Closed boomshadow closed 7 years ago

boomshadow commented 7 years ago

I'm still fairly new using Grape. How to require the gem wasn't obvious to me. I had to dig through other peoples' example code to find the answer. I figured it would be best if the instructions were a little clearer for newer people like myself. Heh heh.

ridiculous commented 7 years ago

Are you not using Bundler?

boomshadow commented 7 years ago

I am using Bundler. But without adding the require 'grape/middleware/logger' to my config.ru, I will get an uninitialized constant error:

<class:API>': uninitialized constant Grape::Middleware::Logger (NameError)
ridiculous commented 7 years ago

So when do you call Bundler.require? That should load all dependencies listed in Gemfile. It should be called before loading your main app (e.g. API)

ridiculous commented 7 years ago

Did that work for you? I'd prefer not to add instructions unless it's really needed. Let me know, otherwise i'll close this issue. Thanks!

ridiculous commented 7 years ago

Closing. Feel free to reopen if you're still having issue. Thanks