简体   繁体   English

尝试在Rails 3中使用调试器-ruby 1.9.3 [重构]

[英]Trying to use a debugger in rails 3 - ruby 1.9.3 [Refactoring]

I'm trying to use a debugger in a homework assignment I'm working on. 我正在尝试在正在进行的作业中使用调试器。 I installed the gem ruby-debug19, but I can't put it to use. 我安装了gem ruby​​-debug19,但无法使用它。 Whenever I put the statement ruby-debug in a method, and I go to the console server it doesn't respond. 每当我将语句ruby-debug放在一个方法中,然后我进入控制台服务器时,它都不会响应。 It's like this: http://imgur.com/zV1IPka 就像这样: http : //imgur.com/zV1IPka

  def index
    ruby-debug
    @search = params[:search] ? params[:search] : {}

    @articles = Article.search_with_pagination(@search, {:page => params[:page], :per_page => this_blog.admin_display_elements})

    if request.xhr?
      render :partial => 'article_list', :locals => { :articles => @articles }
    else
      @article = Article.new(params[:article])
    end
  end

Any help would be really appreciated. 任何帮助将非常感激。 Thanks. 谢谢。

If you want something flexible with the option of setting breakpoints and navigating through code I can recommend pry-debugger . 如果您希望通过设置断点和浏览代码的方式灵活一些,我可以推荐pry-debugger If you want something with glitter and magic jazz_hands is the gem you are looking for. 如果您想要一些闪闪发光且具有魔力的东西, jazz_hands是您要找的宝石。

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

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