Skip to content
sample rails application to reproduce NameError with byebug and zeitwerk
Ruby HTML JavaScript CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db
lib
log
public
storage
test
tmp
vendor
.browserslistrc
.gitignore
.ruby-version
Gemfile
Gemfile.lock
README.md
Rakefile
babel.config.js
config.ru
package.json
postcss.config.js
yarn.lock

README.md

README

  1. git clone https://github.com/willnet/byebug-zeitwerk-sample.git
  2. cd byebug-zeitwerk-sample
  3. ./bin/setup
  4. ./bin/rails s
  5. visit localhost:3000
  6. reference A::B in brakepoint
  7. NameError like following
[1, 6] in /Users/willnet/.ghq/github.com/willnet/byebug-zeitwerk-sample/app/controllers/welcome_controller.rb
   1: class WelcomeController < ApplicationController
   2:   def index
   3:     byebug
   4:     # A::B
=> 5:   end
   6: end
(byebug) A::B
*** NameError Exception: uninitialized constant A::B

edit app/controllers/welcome_controller.rb like following, and revisit localhost:3000

class WelcomeController < ApplicationController
  def index
    A::B
  end
end

it works!

You can’t perform that action at this time.