aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-08-07 17:19:33 +0200
committerGitHub <noreply@github.com>2016-08-07 17:19:33 +0200
commit33ec865e7b15a2fba4a08e35f85273ad773386ac (patch)
tree4c4bf65bc66feab4e81894b4180b7081f646c0d3 /railties/lib
parentff8035dfeed8c86594c32ef8e9204806e190cb58 (diff)
parentbf71b6a57959f00e2b445037996c32ba45802351 (diff)
downloadrails-33ec865e7b15a2fba4a08e35f85273ad773386ac.tar.gz
rails-33ec865e7b15a2fba4a08e35f85273ad773386ac.tar.bz2
rails-33ec865e7b15a2fba4a08e35f85273ad773386ac.zip
Merge pull request #24260 from y-yagi/show_error_message_when_error_raised_in_rails_runner
show error message when error raised in rails runner
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/commands/runner.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb
index 11ef1d10e2..b74addf587 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