Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't escape from eval with next using Pry-rails

Hi I've installed Pry to do some awesome debugging and had it working before but when I step into the code with 'next' I get the following error:

SyntaxError: (eval):2: Can't escape from eval with next 

Code being used:

def create     binding.pry     build_resource(sign_up_params)      if resource.save       yield resource if block_given?       if resource.active_for_authentication?         set_flash_message :notice, :signed_up if is_flashing_format?         sign_up(resource_name, resource)         respond_with resource, :location => after_sign_up_path_for(resource)       else         set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_flashing_format?         expire_data_after_sign_in!         respond_with resource, :location => after_inactive_sign_up_path_for(resource)       end     else       clean_up_passwords resource       respond_with resource     end   end 

Has anyone else had this issue?

like image 230
Shaun Frost Duke Jackson Avatar asked Dec 05 '13 15:12

Shaun Frost Duke Jackson


2 Answers

Please make sure to install the 'pry-nav' gem.

I had the same error because I made the assumption that navigation commands were included into the 'pry-rails' gem.

Add gem 'pry-nav' in your Gemfile, then run bundle install.

like image 110
Aurelien Porte Avatar answered Sep 28 '22 03:09

Aurelien Porte


You can now use pry-byebug gem (for Ruby >= 2.0) or pry-debugger gem (for Ruby <= 1.9).

Use it together with pry gem in your Gemfile:

# Gemfile gem 'pry' gem 'pry-byebug' 
like image 36
exmaxx Avatar answered Sep 28 '22 03:09

exmaxx