rbenv irb历史记录未保存 [英] rbenv irb history is not saving

查看:98
本文介绍了rbenv irb历史记录未保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过 rbenv-installer 安装ruby.

I install ruby via rbenv-installer.

使用irb控制台时,可以通过在键盘上上下按来使用历史记录.当我退出控制台并重新启动时,我无法使用繁琐的历史记录.当我按向上箭头按钮时,什么也没发生.

When I use irb console, I can use history by pressing up and down on keyboard. And when I exited from console and start it again, I can't use prewious history. When I press up-arrow-button, nothing was happened.

当我使用rvm时,此选项有效.如何在rbenv中打开它?

When I used rvm this option was working. How can I switch on it in rbenv?

推荐答案

我找到了解决问题的方法.在〜/.irbrc文件中写:

I found this way for solving my problem. In file ~/.irbrc write:

require 'irb/ext/save-history'
#History configuration
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"

在以下问题中发现: irb历史记录无效

这篇关于rbenv irb历史记录未保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆