No command history in Ruby console

Web Development Web Application Software Development

When using Ruby console (either by irb or rails console, it's very handy to access previous commands by up arrow.

However the history is broken after upgraded Ruby to v2.3+. Turns out it's a native extension readline that required by v2.3+ Ruby was missing during the installation of Ruby.

Here's the quick fix:

brew install readline

rvm uninstall 2.3.0

rvm install 2.3.0`

For rbenv, see more from here