简体   繁体   English

在OS X上调试Ruby 2.1调试

[英]Recipe for Ruby 2.1 debugging on OS X

I'm looking for a way to debug in ruby 2.1 on OSX. 我正在寻找一种在OSX上调试ruby 2.1的方法。 Specifically: 特别:

  • Ruby 2.1.0 Ruby 2.1.0
  • Rails (3.2.recent) Rails(3.2.recent)
  • OS X 10.9.1 OS X 10.9.1

I'm looking for a recipe that will let me stop at breakpoints, step, next, etc. I've used the debugger gem in the past, ruby-debug, and also byebug. 我正在寻找一个让我在断点,步骤,下一步等处停下来的配方。我过去使用过调试器gem,ruby-debug,以及byebug。 I'm having trouble getting any of 'em to build. 我无法让任何人建造它们。

Anyone have a recipe that works? 有人有配方吗? Thanks! 谢谢!

Working with pry is a great option when you want to debug. 当您想要调试时,使用pry是一个很好的选择。

Checkout the vid tutorial http://pryrepl.org/screencasts.html which showcases some of the features of it. 查看视频教程http://pryrepl.org/screencasts.html ,其中展示了它的一些功能。

I generally use these gems for debugging: 我通常使用这些宝石进行调试:

group :development do
  gem 'pry'
  gem 'pry-nav'
  gem 'pry-rescue'
  gem 'pry-stack_explorer'
  gem 'pry-doc'
end

Hope it helps! 希望能帮助到你!

你也可以签出byebug ,它是版本> = 2.0的简单ruby调试器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM