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

Rails debugging support #14533

Closed
deivid-rodriguez opened this issue Mar 30, 2014 · 13 comments
Closed

Rails debugging support #14533

deivid-rodriguez opened this issue Mar 30, 2014 · 13 comments
Labels

Comments

@deivid-rodriguez
Copy link
Contributor

Ruby 2 has been out there for more than a year, and the debugger gem still doesn't provide support for it.

I think it's time we stop providing it in the default Gemfile. A lot of a debugger's users are beginners learning the language/framework. In my opinion, being "officially" recommended a software that doesn't work can be discouraging for them.

If this is agreed, there are a number of options:

  • Don't recommend a default debugger at all in the Gemfile.
  • Replace it with byebug, which seems to be de debugger of choice for ruby >= 2.0

In any case, specific code to support debugger (such as https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/kernel/debugger.rb or https://github.com/rails/rails/blob/master/railties/lib/rails/rack/debugger.rb) could be removed because byebug doesn't need it anymore.

Let me know if you would accept this change so I can get a Pull Request ready.

Cheers!

@rafaelfranca
Copy link
Member

You are right, we need to change it. I think we may prefer to point to https://github.com/ko1/debugger2, but I really wish we could merge this project with the original debugger gem.

@ko1 is there something missing to merge your fork with the original debugger gem?

@rafaelfranca
Copy link
Member

Other thing that we need to think about is how support Ruby 1.9 and Ruby 2.0 applications. We are not planning to remove support to 1.9 yet.

@deivid-rodriguez
Copy link
Contributor Author

As far as I know, @ko1 recommends byebug for 2.0 debugging.

Regarding keeping support for Ruby 1.9, I think debugger monkeypatches should be moved to the debugger gem.

@schneems
Copy link
Member

Can we use bundlers platform feature to include both debuggers in the default Gemfile?

@deivid-rodriguez
Copy link
Contributor Author

I like that idea too

gem 'debugger', platform: :mri_19, group: [:development, :test]
gem 'byebug', platform: [:mri_20, :mri_21], group: [:development, :test]

@guilleiguaran
Copy link
Member

We can detect the ruby version during the application creation and add the appropiate gem to Gemfile.

@ko1
Copy link
Contributor

ko1 commented Mar 30, 2014

(2014/03/31 5:48), David Rodríguez wrote:

As far as I know, @ko1 https://github.com/ko1 recommends |byebug| for
2.0 debugging.

Yes.

// SASADA Koichi at atdot dot net

@arthurnn
Copy link
Member

👍 for using byebug on 2.0+ . We are using it for a while already.

@rafaelfranca
Copy link
Member

@ko1 thank you for replying.

@deivid-rodriguez please go ahead and open a PR 😄

@deivid-rodriguez
Copy link
Contributor Author

@rafaelfranca Ok, I will. So we want to keep support for debugger gem, right? In that case I was thinking of adding some if RUBY_VERSION < '2.0.0' around. I ask because there are very few of them in rails code...

@rafaelfranca
Copy link
Member

If we have a way to feature detect I'd prefer to do it. But if we don't it is fine to check the RUBY_VERSION

@deivid-rodriguez
Copy link
Contributor Author

Ok, I'll work on this and get back to you. Cheers!

@rafaelfranca
Copy link
Member

Implemented at #14646

techieshark added a commit to codeforamerica/MuniciPal that referenced this issue Oct 31, 2014
- 2.1.2 is recommended on Heroku:
  https://devcenter.heroku.com/changelog-items/468

- `debugger` gem does not build on 2.1.2; switching to `byebug` 
   `bye bug` is the recommended debugger for current Ruby + Rails (see cldwalker/debugger#125 (comment) and rails/rails#14533)

- The following commands may help in switching your local version (assuming you use rbenv):

	rbenv install 2.1.2
	rbenv local 2.1.2
	gem install bundler
	bundle
techieshark added a commit to codeforamerica/MuniciPal that referenced this issue Oct 31, 2014
- 2.1.2 is recommended on Heroku:
  https://devcenter.heroku.com/changelog-items/468

- `debugger` gem does not build on 2.1.2; switching to `byebug`
   `bye bug` is the recommended debugger for current Ruby + Rails (see cldwalker/debugger#125 (comment) and rails/rails#14533)

- The following commands may help in switching your local version (assuming you use rbenv):

	rbenv install 2.1.2
	rbenv local 2.1.2
	gem install bundler
	bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants