Skip to content

Instantly share code, notes, and snippets.

@gmcabrita
Created December 12, 2022 15:39
Show Gist options
  • Save gmcabrita/11cc1add7e49ae5c8de3ed6a80eab678 to your computer and use it in GitHub Desktop.
Save gmcabrita/11cc1add7e49ae5c8de3ed6a80eab678 to your computer and use it in GitHub Desktop.
How to install a ruby gem and load it directly in the console without changing the Gemfile
gem_name = "ruby-progressbar"
`gem install #{gem_name}`
gem_folder_path = `gem which #{gem_name}`.strip.toutf8.gsub("#{gem_name}.rb", "")
$: << gem_folder_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment