From c7c25edf17508e4d71fbf67bca4ef13e4dea2016 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 8 Dec 2014 15:27:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8Apry=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 6 +++--- Gemfile.lock | 20 ++++++++++++++++---- app/api/mobile/apis/users.rb | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 5288edd52..ab7a41a16 100644 --- a/Gemfile +++ b/Gemfile @@ -49,9 +49,9 @@ group :development, :test do gem 'guard-spork', '~> 1.5.1' gem 'guard-test', '~> 1.0.0' gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/ - gem 'pry' - gem 'pry-nav' - + gem 'pry-rails' + gem 'pry-byebug' + gem 'pry-remote' end diff --git a/Gemfile.lock b/Gemfile.lock index 58f069ac1..d2ae03453 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,6 +57,9 @@ GEM ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) builder (3.0.0) + byebug (2.7.0) + columnize (~> 0.3) + debugger-linecache (~> 1.2) capybara (2.4.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -81,6 +84,8 @@ GEM coffee-script-source execjs coffee-script-source (1.7.1) + columnize (0.9.0) + debugger-linecache (1.2.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) equalizer (0.0.9) @@ -170,8 +175,14 @@ GEM method_source (~> 0.8) slop (~> 3.4) win32console (~> 1.3) - pry-nav (0.2.3) - pry (~> 0.9.10) + pry-byebug (1.3.2) + byebug (~> 2.7) + pry (~> 0.9.12) + pry-rails (0.3.2) + pry (>= 0.9.10) + pry-remote (0.1.8) + pry (~> 0.9) + slop (~> 3.0) puma (2.10.1) rack (>= 1.1, < 2.0) rack (1.4.5) @@ -305,8 +316,9 @@ DEPENDENCIES net-ldap (~> 0.3.1) nokogiri (~> 1.6.3) paperclip (~> 3.5.4) - pry - pry-nav + pry-byebug + pry-rails + pry-remote puma rack-mini-profiler! rack-openid diff --git a/app/api/mobile/apis/users.rb b/app/api/mobile/apis/users.rb index c9ecdd84f..489b3e419 100644 --- a/app/api/mobile/apis/users.rb +++ b/app/api/mobile/apis/users.rb @@ -17,7 +17,7 @@ module Mobile begin user = us.register params.merge(:password_confirmation => params[:password], :should_confirmation_password => true) - raise "register failed." if user.new_record? + raise "register failed #{user.errors.full_messages}" if user.new_record? {status: 0, data: user} rescue => e {status: 1, message: e.message}