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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error undefined local variable or method `view_context' #14

Closed
enderahmetyurt opened this issue Aug 1, 2021 · 2 comments
Closed
Labels
bug 馃悰 Something isn't working

Comments

@enderahmetyurt
Copy link

When I clickt he little hedgehog 馃 on the top left, I get error Getting error undefined local variable or method view_context'`

details of the error:

NameError in RailsMiniProfiler::ProfiledRequestsController#show

rails_mini_profiler (0.1.1) app/controllers/rails_mini_profiler/application_controller.rb:13:in `present'
rails_mini_profiler (0.1.1) app/controllers/rails_mini_profiler/profiled_requests_controller.rb:22:in `block in show'

Steps to Reproduce

  1. Do all thing from installation
  2. Add mount RailsMiniProfiler::Engine => '/rails_mini_profiler' to routes.rb
  3. Restart rails server

Technical details

  • Rails version: 6.1.4
  • Ruby version: 2.7.2
  • This a Rails API project
@hschne
Copy link
Owner

hschne commented Aug 1, 2021

Thanks for your bugreport! 馃檶

I already merged a fix, if you want to give it a try (and not wait for another release), please modify your Gemfile like so:

gem "rails_mini_profiler", git: "https://github.com/hschne/rails-mini-profiler"

Additionally, I updated the readme with some information on additional measures you may have to take to get Rails Mini Profiler running in your API-only app. See here.

Let me know how it goes! I'd love to get more feedback from you to better support API-only apps 馃檪

@hschne hschne added this to In progress in Major Release Aug 1, 2021
@hschne hschne moved this from In progress to Done in Major Release Aug 1, 2021
@enderahmetyurt
Copy link
Author

thank you @hschne it's working now. I just want to say, Gemfile should be like this

gem "rails_mini_profiler", git: "https://github.com/hschne/rails-mini-profiler", branch: 'main'

I will share my experience about it on API only app 馃槈

@hschne hschne moved this from Done to Released in Major Release Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 馃悰 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants