9/27/2018 - 10:54 AM

Use any gem on any ruby (bundle) console

Download and use any desired ruby console, even if it's using bundle.

# Install the gem
system 'gem install <gemname> -v <version>'

# Require its load path (depends on the gem file tree)
$LOAD_PATH << "#{`gem env gemdir`.strip}/gems/<gemname-version>/lib"

# Require the gem file
require '<gemname>'

# For example:
system 'gem install differ -v 0.1.2'
$LOAD_PATH << "#{`gem env gemdir`.strip}/gems/differ-0.1.2/lib"
require 'differ'