Skip to content

Instantly share code, notes, and snippets.

@sohocoke
Last active February 28, 2022 19:51
Show Gist options
  • Save sohocoke/370161d6e04ba0e1ebc09d821193608b to your computer and use it in GitHub Desktop.
Save sohocoke/370161d6e04ba0e1ebc09d821193608b to your computer and use it in GitHub Desktop.
# # Fixing key bindings for `irb`
#
# when your ruby comes from `brew`, `rbenv`, and arrow keys don't work in your `irb`
brew upgrade readline rbenv ruby-install # ensure we have the `readline` library, and a recent version of `ruby-install` which will link to it properly when building `ruby`.
rbenv install <your-favourite-ruby-version> # rebuild ruby.
# watch out for the message 'ruby-build: use readline from homebrew' in output from the command above,
# then, go get some coffee.
# ...
# and eventually, check that the arrow keys work in irb.
irb
@jagdeepsingh
Copy link

Worked for me on macOS High Sierra 10.13.6. 🥇

@doggyeh
Copy link

doggyeh commented Jul 11, 2019

Awesome! fixed my issue

@wizardone
Copy link

Many thanks from me as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment