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.
bundle check before attempting installsbundle install if needed (with configurable timeout)gem install if not already presentUsing 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) |
Gemfile in the current directory or a parent directory. The plugin will show a warning if no Gemfile is found.bundle install, it won't retry automatically. Use :GemInstallCacheClear to reset and try again.bundle install has a 60 second timeout by default (configurable via bundle_install_timeout).