Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ByeBug Debugger working only once [Rails 4]

I'm having the problem that byebug class are ignored after the first one. It's very strange. I start the server. Whenever there is a byebug statement, if it is the first one since the server has started, it will work. If not, it will say this message: *** Byebug already started. Ignoringbyebugcall. and the only way for the debugger to work would be to restart the server (and it will only work once).

Any help would be really appreciated.

BTW, this happens with every project.

Thanks.

like image 626
FranGoitia Avatar asked Mar 31 '15 19:03

FranGoitia


People also ask

How do you skip the Byebug?

Typing finish in the console exits byebug, without closing pry/rails console/rails server. Ctrl + D also works.

How do you use Byebug in Ruby?

wherever you'd like the application to "break" - that is, executing byebug is equivalent to putting a breakpoint in your code. Run the program and use the debugger commands once you reach the breakpoint. near the end. Restart your server.

How do I run a Ruby script in debug mode?

In order to start the Ruby debugger, load the debug library using the command-line option -r debug. The debugger stops before the first line of executable code and asks for the input of user commands.

What is Byebug gem?

Byebug is a Ruby 2 debugger. It's implemented using the Ruby 2 TracePoint C API for execution control and the Debug Inspector C API for call stack navigation. The core component provides support that front-ends can build on.


1 Answers

This has been reported and fixed, but isn't in a release yet.

To work around for now you update your Gemfile with:

gem 'byebug', github: 'deivid-rodriguez/byebug', branch: 'master'

Then bundle update byebug and restart your Rails server.

like image 77
davetapley Avatar answered Sep 20 '22 08:09

davetapley