Rails Hirb in console for outputting long data breaks console

377 Views Asked by At

I'm using Rails 4.2 with Hirb in console.

and when I try to output long/big data in console. the console breaks.

it shows (END) and I can't type or run other commands anymore, and what I must do in order to fix is to close the console.

Is there any way I can configure for Hirb or commands to exit the (END) status?

Here is an example what I did

$ spring rails c -s
Loading development environment in sandbox (Rails 4.2.0)
Any modifications you make will be rolled back on exit
[1] pry(main)> an = []
=> []
[2] pry(main)> an << {account: Account.first}
  Account Load (1.4ms)  SELECT  "accounts".* FROM "accounts" WHERE "accounts"."deleted_at" IS NULL  ORDER BY "accounts"."id" ASC LIMIT 1
=> [{:account=>
   #<Account:0x007fbbb363feb8
    id: 1,
    ................
    ................
    deleted_at: nil,
    created_at: Thu, 12 Mar 2015 03:03:35 UTC +00:00,
    updated_at: Thu, 12 Mar 2015 03:10:40 UTC +00:00>}]
[3] pry(main)> an << {account: Account.second}
  Account Load (0.6ms)  SELECT  "accounts".* FROM "accounts" WHERE "accounts"."deleted_at" IS NULL  ORDER BY "accounts"."id" ASC LIMIT 1 OFFSET 1
=> [{:account=>
   #<Account:0x007fbbb363feb8
    id: 1,
    ................
    ................
    deleted_at: nil,
    created_at: Thu, 12 Mar 2015 03:03:35 UTC +00:00,
    updated_at: Thu, 12 Mar 2015 03:10:40 UTC +00:00>},
 {:account=>
   #<Account:0x007fbbb736acc0
    id: 2,
    ................
    ................
    deleted_at: nil,
    created_at: Thu, 12 Mar 2015 03:03:36 UTC +00:00,
    updated_at: Thu, 12 Mar 2015 03:10:36 UTC +00:00>}]
(END) 
1

There are 1 best solutions below

1
On BEST ANSWER

You can navigate through your data with up and down arrows, or quit with 'q'.