Today I was in a Pry session, and I wanted to visualize something with Awesome Print. I didn't have Awesome Print installed in the version of Ruby I was using, so requiring it wasn't possible. However Ruby is a dynamic language, and it let me install the gem and require it without closing my session or loosing any work. Check out the console commands and output below.

[19] pry(main)> require 'ap'
LoadError: cannot load such file -- ap
from /usr/local/opt/rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[20] pry(main)> require 'ap'
LoadError: cannot load such file -- ap
from /usr/local/opt/rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[21] pry(main)> Gem
Gem
[22] pry(main)> Gem.inst<tab>
Gem.install
Gem.install_extension_in_lib
Gem.instance_eval
Gem.instance_exec
Gem.instance_method
Gem.instance_methods
Gem.instance_of?
Gem.instance_variable_defined?
Gem.instance_variable_get
Gem.instance_variable_set
Gem.instance_variables
[22] pry(main)> Gem.install 'awesome_print'
Fetching: awesome_print-1.2.0.gem (100%)
=> [Gem::Specification.new do |s|
     # ...
   end]
[23] pry(main)> require 'ap'
=> true

Ruby is awesome!