diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-03-21 10:08:38 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-08-03 12:16:16 +0900 |
commit | bf71b6a57959f00e2b445037996c32ba45802351 (patch) | |
tree | 47d6757f3bc9a7816f1cfdcce1293f5df22f5993 /railties/lib/rails/commands | |
parent | d46d61e46e0053efefcc5409795c1121510c2038 (diff) | |
download | rails-bf71b6a57959f00e2b445037996c32ba45802351.tar.gz rails-bf71b6a57959f00e2b445037996c32ba45802351.tar.bz2 rails-bf71b6a57959f00e2b445037996c32ba45802351.zip |
show error message when error raised in rails runner
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/runner.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb index f9c183ac86..1ec10a8a37 100644 --- a/railties/lib/rails/commands/runner.rb +++ b/railties/lib/rails/commands/runner.rb @@ -61,9 +61,11 @@ elsif File.exist?(code_or_file) else begin eval(code_or_file, binding, __FILE__, __LINE__) - rescue SyntaxError, NameError + rescue SyntaxError, NameError => e $stderr.puts "Please specify a valid ruby command or the path of a script to run." $stderr.puts "Run '#{command} -h' for help." + $stderr.puts + $stderr.puts e exit 1 end end |