Install Ruby gems from Neovim! Handles bundle install and gem install with progress notifications and caching to prevent retries when installs fail. Useful for LSP servers and other tools that depend on gems being available.
- Runs
bundle checkbefore attempting installs - Runs
bundle installif needed (with configurable timeout) - Installs gems via
gem installif not already present - Caches failures per-project to avoid repeated attempts
- Shows progress via fidget.nvim
- Logs all output for debugging
- fidget.nvim (for progress UI)
Using lazy.nvim:
{
"cosmicbuffalo/gem_install.nvim",
opts = {},
dependencies = { "j-hui/fidget.nvim" },
}require("gem_install").install("ruby-lsp")-- Optional, below are built in defaults
require("gem_install").setup({
-- Timeout for bundle install in milliseconds
bundle_install_timeout = 60000,
-- Cache file for tracking failed installs
cache_file = vim.fn.stdpath("cache") .. "/bundle_install_cache.json",
-- Log file for debug output
log_file = vim.fn.stdpath("log") .. "/bundle_gem_debug.log",
})| Command | Description |
|---|---|
:GemInstall <gem> |
Install a gem |
:GemInstallLog |
Open the debug log file |
:GemInstallLogClear |
Clear the debug log |
:GemInstallCache |
Open the failure cache file |
:GemInstallCacheClear |
Clear failure cache (retries failed projects) |
- Requires a
Gemfilein the current directory or a parent directory. The plugin will show a warning if no Gemfile is found. - Once a project fails
bundle install, it won't retry automatically. Use:GemInstallCacheClearto reset and try again. bundle installhas a 60 second timeout by default (configurable viabundle_install_timeout).