1

我在控制台中使用带有 Hirb 的 Rails 4.2。

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

它显示了(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) 
4

1 回答 1

2

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

于 2015-03-12T09:59:44.370 回答