简体   繁体   English

控制台中的Rails Hirb用于输出长数据中断控制台

[英]Rails Hirb in console for outputting long data breaks console

I'm using Rails 4.2 with Hirb in console. 我在控制台中使用带有Hirb的Rails 4.2。

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. 它显示(END)并且我无法再键入或运行其他命令,并且要修复该问题,必须关闭控制台。

Is there any way I can configure for Hirb or commands to exit the (END) status? 有什么方法可以配置Hirb或命令以退出(END)状态?

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) 

您可以使用上下箭头浏览数据,也可以使用“ q”退出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM