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

[2.x] Debugging documentation for hanami server #224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions content/v2.0/cli-commands/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,29 @@ This server is for local development only. In production, use the following to s
$ bundle exec puma -C config/puma.rb
```

### Debugging

Since Hanami uses code reloading by default, placing a `binding.irb`
call in your code won't open an IRB debugging session in the server
logs as you might expect.

Within your own application code, you call `raise` to trigger the
[hanami-webconsole][wc] interactive error page and interact with
the execution context in an IRB-like REPL.

[webconsole]: https://github.com/hanami/webconsole

However, this will not work with third-party code like gems. In that
case you can disable code reloading by starting the server with:

```shell
bundle exec hanami server --no-code-reloading
```

Calls to `binding.irb` (or `binding.pry` for Pry) should now
work, not only in your Hanami application code. The IRB debugging
console will open your shell wherever you started the Hanami server.

## hanami version

Prints the version of the installed hanami gem.
Expand Down
23 changes: 23 additions & 0 deletions content/v2.1/cli-commands/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,29 @@ This server is for local development only. In production, use the following to s
$ bundle exec puma -C config/puma.rb
```

### Debugging

Since Hanami uses code reloading by default, placing a `binding.irb`
call in your code won't open an IRB debugging session in the server
logs as you might expect.

Within your own application code, you call `raise` to trigger the
[hanami-webconsole][wc] interactive error page and interact with
the execution context in an IRB-like REPL.

[webconsole]: https://github.com/hanami/webconsole

However, this will not work with third-party code like gems. In that
case you can disable code reloading by starting the server with:

```shell
bundle exec hanami server --no-code-reloading
```

Calls to `binding.irb` (or `binding.pry` for Pry) should now
work, not only in your Hanami application code. The IRB debugging
console will open your shell wherever you started the Hanami server.

## hanami version

Prints the version of the installed hanami gem.
Expand Down