1

I have the same problem as this question. I use byebug in this class:

class BasesController < ApplicationController
  before_action :set_available_bases, only: [:index]

  def index
  end

  private
  def set_available_bases
    byebug
    @bases = Base.all
  end

end

And I get

NameError (undefined local variable or method `byebug' for #<BasesController:0x5952e10>):

If I add require 'byebug' as proposed in the first answer, I get cannot load such file -- byebug. byebug is already, by default with Rails 5, in my Gemfile

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platform: :mri
end

I have already run gem install byebug, bundler install. I have ruby 2.3.3p222, rails 5.0.1, running on Windows 10.

Any idea of how to solve this?

garci560
  • 2,993
  • 4
  • 25
  • 34

0 Answers0