Ruby学习笔记 irb Tab 代码补全 Mac OS

来源:互联网 发布:做数据分析用什么软件 编辑:程序博客网 时间:2024/05/19 12:15

在 Mac OS 上 安装完 ruby 2.0.0 ,打开 irb 开始练习 Ruby ,但是发现没有Tab代码补全功能,google解决,方案如下

1、安装 bond 执行如下命令即可

sudo gem install bond

2、在当前用户根目录创建 .irbrc

vi ~/.irbrc
3、在文件中添加如下内容

require 'bond' Bond.start
4、保存关闭文件即可

再次打开 irb 就可以使用 tab 补全代码了


This is what worked for me on Mac OS 10.11.5. using rvm. Do the following :

  1. sudo gem install bond
  2. Create the file .irbrc in your home directory. vi ~/.irbrc
  3. Add the following lines in the .irbrc file require 'bond' Bond.start

  4. Save and close the file

  1. Open irb and use tab key to autocomplete

0 0
原创粉丝点击