{"record":{"id":"943adc9e2635a653","repo":"oraios/serena","slug":"this-appears-to-be-a-bundler-project-but-solargra","errorCode":null,"errorMessage":"This appears to be a Bundler project, but solargraph is not available. Please add 'gem \"solargraph\"' to your Gemfile and run 'bundle install'.","messagePattern":"This appears to be a Bundler project, but solargraph is not available\\. Please add 'gem \"solargraph\"' to your Gemfile and run 'bundle install'\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/solargraph.py","lineNumber":196,"sourceCode":"            ]\n\n            dependency = runtime_dependencies[0]\n            try:\n                result = subprocess_run(\n                    [\"gem\", \"list\", \"^solargraph$\", \"-i\"], check=False, capture_output=True, text=True, cwd=repository_root_path\n                )\n                if result.stdout.strip() == \"false\":\n                    log.info(\"Installing Solargraph...\")\n                    subprocess_run(dependency[\"installCommand\"].split(), check=True, capture_output=True, cwd=repository_root_path)\n\n                return \"gem exec solargraph\"\n            except subprocess.CalledProcessError as e:\n                error_msg = e.stderr.decode() if e.stderr else str(e)\n                raise RuntimeError(\n                    f\"Failed to check or install Solargraph: {error_msg}\\nPlease try installing manually: gem install solargraph\"\n                ) from e\n        else:\n            raise RuntimeError(\n                \"This appears to be a Bundler project, but solargraph is not available. \"\n                \"Please add 'gem \\\"solargraph\\\"' to your Gemfile and run 'bundle install'.\"\n            )\n\n    @staticmethod\n    def _detect_rails_project(repository_root_path: str) -> bool:\n        \"\"\"\n        Detect if this is a Rails project by checking for Rails-specific files.\n        \"\"\"\n        rails_indicators = [\n            \"config/application.rb\",\n            \"config/environment.rb\",\n            \"app/controllers/application_controller.rb\",\n            \"Rakefile\",\n        ]\n\n        for indicator in rails_indicators:\n            if os.path.exists(os.path.join(repository_root_path, indicator)):","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/solargraph.py#L178-L214","documentation":"Raised by Solargraph's _setup_runtime_dependencies when the repository looks like a Bundler project (a Gemfile exists) but the solargraph gem is not available via bundle. The library refuses to fall back to a global gem install because a Bundler project must resolve the server through its own Gemfile for version consistency.","triggerScenarios":"Starting the Solargraph server on a repo containing a Gemfile where solargraph was never added, or was added but `bundle install` was never run, or it's in a non-default gem group/section that bundle exec doesn't load.","commonSituations":"Cloning a Ruby project without following its README setup, solargraph listed only in a dev group on a machine bundling without that group, or a stale Gemfile.lock.","solutions":["Add `gem \"solargraph\"` to the Gemfile and run `bundle install`.","Verify availability with `bundle exec solargraph --version` from the repo root.","If solargraph is in a group, run `bundle install` with that group enabled (e.g. `bundle config set --local with development`).","If the Gemfile is unrelated to this workspace, run the server from the correct project root or remove the stray Gemfile."],"exampleFix":"// before\n# Gemfile\n# (no solargraph)\n// after\n# Gemfile\ngem \"solargraph\", group: :development","handlingStrategy":"validation","validationCode":"from pathlib import Path\nimport subprocess\ngemfile = Path(repo_root) / \"Gemfile\"\nif gemfile.exists():\n    r = subprocess.run([\"bundle\", \"exec\", \"solargraph\", \"--version\"], cwd=repo_root, capture_output=True, text=True)\n    if r.returncode != 0:\n        subprocess.run([\"bundle\", \"install\"], cwd=repo_root, check=True)","typeGuard":"def bundler_solargraph_ready(repo_root: str) -> bool:\n    import subprocess\n    from pathlib import Path\n    if not (Path(repo_root) / \"Gemfile\").exists():\n        return True\n    return subprocess.run(\n        [\"bundle\", \"exec\", \"solargraph\", \"--version\"],\n        cwd=repo_root, capture_output=True\n    ).returncode == 0","tryCatchPattern":"try:\n    server = SolargraphLanguageServer(config, repo_root, settings)\nexcept RuntimeError as e:\n    if \"Bundler project\" in str(e):\n        subprocess.run([\"bundle\", \"add\", \"solargraph\"], cwd=repo_root, check=True)\n        subprocess.run([\"bundle\", \"install\"], cwd=repo_root, check=True)\n        server = SolargraphLanguageServer(config, repo_root, settings)\n    else:\n        raise","preventionTips":["Always run `bundle install` after cloning a Ruby project before starting LSP tooling.","Commit Gemfile.lock with solargraph included so environments stay reproducible.","Verify with `bundle exec solargraph --version` from the repo root."],"tags":["ruby","bundler","gemfile","solargraph"],"backgroundTag":"bundler-gem-missing","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}