Class: Gemvault::CLI::Commands::Doctor

Inherits:
Gemvault::CLI::Command show all
Defined in:
lib/gemvault/cli/commands/doctor.rb

Overview

Recovers from a bundler plugin index entry whose stored path no longer exists. Bundler records absolute paths in .bundle/plugin/index for path-installed plugins. Moving or renaming the source directory leaves an invalid path behind -- Bundler::Plugin.load_plugin warns "The following plugin paths don't exist: ..." and silently returns, leaving @sources nil. The next source X, type: :vault crashes inside Bundler::SourceList#add_plugin_source with NoMethodError on nil.

Uninstalling clears the broken entry; re-running bundle install triggers Bundler to reinstall the plugin against whatever the current Gemfile declares. Run this from the project directory.

Instance Method Summary collapse

Instance Method Details

#runObject



21
22
23
24
# File 'lib/gemvault/cli/commands/doctor.rb', line 21

def run
  system("bundle", "plugin", "uninstall", "bundler-source-vault", exception: true)
  exec("bundle", "install")
end