简体   繁体   中英

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. Whenever I put the statement ruby-debug in a method, and I go to the console server it doesn't respond. It's like this: 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 . If you want something with glitter and magic jazz_hands is the gem you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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