From 56c3b49bef4bd45b1e4255829da543bbe1aa988e Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 5 May 2025 13:45:57 +0100 Subject: [PATCH] fix(mise/ruby): move global gems back to shell helper Mise is only suitable for gems which expose self-contained CLI tools that don't interact with other Ruby-based tools. Because it sets GEM_HOME to the specific gem's install path, things like `foreman` cannot launch Rails apps, cause any Ruby-based child processes will not find any gems they expect. --- config/mise/config.toml | 13 ------------- zsh/ruby.zsh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/config/mise/config.toml b/config/mise/config.toml index e353410..4dab62b 100644 --- a/config/mise/config.toml +++ b/config/mise/config.toml @@ -41,19 +41,6 @@ ruby_install = true "cargo:eza" = "latest" "cargo:kubectl-watch" = "latest" "cargo:paper-terminal" = "latest" -"gem:dotenv" = "latest" -"gem:erb_lint" = "latest" -"gem:foreman" = "latest" -"gem:reek" = "latest" -"gem:rubocop" = "latest" -"gem:ruby-lsp" = "latest" -"gem:ruby-lsp-rails" = "latest" -"gem:solargraph" = "latest" -"gem:solargraph-rails" = "latest" -"gem:syntax_tree" = "latest" -"gem:syntax_tree-haml" = "latest" -"gem:syntax_tree-rbs" = "latest" -"gem:yard" = "latest" "go:github.com/rakyll/hey" = "latest" "go:google.golang.org/grpc/cmd/protoc-gen-go-grpc" = "latest" "go:google.golang.org/protobuf/cmd/protoc-gen-go" = "latest" diff --git a/zsh/ruby.zsh b/zsh/ruby.zsh index b272108..9edbb61 100755 --- a/zsh/ruby.zsh +++ b/zsh/ruby.zsh @@ -39,3 +39,33 @@ alias he="heroku" alias f="foreman" alias fs="foreman start" alias fr="foreman run" + +# ============================================================================== +# global ruby packages +# ============================================================================== + +install_ruby_global_packages() { + local packages=( + 'bundler:~> 1.0' + 'bundler:~> 2.0' + bundler-audit + dotenv + erb_lint + foreman + method_source + pry-doc + reek + rubocop + ruby-lsp + ruby-lsp-rails + solargraph + solargraph-rails + steep + syntax_tree + syntax_tree-haml + syntax_tree-rbs + yard + ) + + gem install --no-document "${packages[@]}" +}