I’m trying to run a jruby -S rake db:migrate operation.
This results in an error, which exceeds the number of lines my bash terminal holds, so I can’t see the most relevant lines, and I’m stuck with ~1000 lines of:
....
org/jruby/runtime/Block.java:89:in `call'
org/jruby/RubyProc.java:261:in `call'
org/jruby/RubyProc.java:249:in `call19'
org/jruby/RubyProc$INVOKER$i$0$0$call19.gen:-1:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:216:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:212:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:202:in `call'
org/jruby/ast/CallTwoArgNode.java:59:in `interpret'
....
I tried jruby -S rake db:migrate > migrate.out but the error messages still appear on my terminal and the contents of migrate.out is
== ChangeFieldsOnFoo: migrating ========================================
-- remove_column(:foos, :bar)
Surely there must be a way to read this error message!
Tie
stderr(2) tostdout(1) using2>&1and pipe (|) the output through a “pager” such aslessto keep it on the screen until you have finished with it: