Rails Hirb在控制台中输出长数据中断控制台

时间:2015-03-12 06:56:22

标签: ruby-on-rails rails-console hirb

我在控制台中使用Rails 4.2和Hirb。

当我尝试在控制台中输出长/大数据时。控制台坏了。

它显示(END),我无法再输入或运行其他命令,而我必须做的就是关闭控制台。

我有什么办法可以配置Hirb或命令退出(END)状态吗?

这是我做的一个例子

$ 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 个答案:

答案 0 :(得分:1)

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