GitHub Copilot in RubyMine: Setup and Ruby Project Context

GitHub Copilot works in RubyMine through the official JetBrains plugin. Here is how to install it, give Copilot good Ruby project context, and keep shared rules and reusable prompts available outside the IDE session.

Updated 5 min read

GitHub Copilot works in RubyMine through the official GitHub Copilot plugin for JetBrains IDEs. Once installed, it offers inline completions and a chat panel inside your existing RubyMine workspace. Tools like fenbs let you keep shared project rules, architecture decisions, and reusable prompts outside the IDE session so they are available to any connected assistant regardless of which tool you open.

This guide covers installing the plugin, improving the quality of Ruby suggestions, and keeping project requirements in a place where every session can use them.

Installing GitHub Copilot in RubyMine

  1. Open RubyMine and go to Settings (or Preferences on macOS), then Plugins.
  2. Search for "GitHub Copilot" in the Marketplace tab and click Install.
  3. Restart RubyMine when prompted.
  4. After restarting, go to Tools, then GitHub Copilot, then Login to GitHub. Follow the browser-based sign-in.
  5. Confirm the plugin is active by checking for the Copilot icon in the status bar and opening a .rb file to test completions.

You need a GitHub account with Copilot access. For team licensing, see GitHub Copilot business plans and GitHub Copilot license. Check the GitHub Copilot plugin page (opens in a new tab) on the JetBrains Marketplace for the current compatible version of RubyMine.

Giving Copilot good Ruby project context

Copilot reads the files open in your editor and the code near the cursor when it forms suggestions. In Ruby projects, this means the quality of suggestions depends partly on what is visible. Opening the relevant model, controller, and spec files together gives Copilot more of the project structure to work from.

Writing a comment above the method or class you want to generate also helps. A comment like # validates presence of email and uniqueness across the account scope gives Copilot a precise target. Without a comment, it guesses from the method name, which is less reliable in domain-specific Ruby code.

Gemfile.lock and schema.rb are particularly useful context files. Copilot can reference gem versions and database column names when those files are open, producing suggestions that match your actual dependencies rather than hypothetical ones.

Sharing project requirements across the team

When a Ruby project has established conventions — a naming pattern, an approved way to handle errors, a rule about which gems to use for a given job — those need to reach every developer and every AI session consistently. A comment in one file does not scale.

One option is a .github/copilot-instructions.md file in the repository, which Copilot reads as persistent context for the project. This works well for rules that should always apply. For decisions that change as the project evolves, a separate record that can be updated without changing the codebase is more practical.

How fenbs helps

Keep shared rules and project context for every Ruby session

Record your Ruby project conventions, architecture decisions, and approved patterns as Decisions and rules in fenbs. Connected AI assistants read these rules before each session, so they apply to every contributor without requiring everyone to remember a README section or repeat the same prompt. Store reusable prompts in the Skills and prompts library so any assistant can find and use them.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

Using Copilot chat for Ruby debugging and explanation

Beyond inline completions, Copilot chat in RubyMine lets you ask questions about the code you are looking at. Select a method or a block of code, open the chat panel, and ask Copilot to explain what it does, identify potential bugs, or suggest a refactoring. This is particularly useful when inheriting an unfamiliar Ruby codebase or debugging a complex ActiveRecord query.

When asking Copilot to explain an error, paste the full stack trace and the relevant code snippet. Ruby stack traces can be long; the more context Copilot has, the more specific its explanation will be. For RSpec failures, include the test itself and the method under test so Copilot can reason about what the test expects versus what the code produces.

Chat responses in RubyMine work well for scoped, specific questions. Asking "why does this query return nil?" with the query and schema visible tends to produce a more useful answer than asking "fix my application." Keeping the question narrow and the context visible is the same principle as writing a focused comment for inline completion.

Keeping reusable prompts for Ruby work

Some prompts are worth reusing: the instruction to add an RSpec test for every new method, the format for a service object, the reminder to add strong parameter validation. Typing these out fresh each session loses the precision built up over time.

A shared prompts library that a connected assistant can list and read at any time means the instruction is ready without re-typing. This is distinct from Copilot's own project instructions: a prompts library is available across sessions, projects, and tools, not just inside one repository.

How to do this with fenbs

  1. Create a free account and add a project for the Ruby application.
  2. Write the team's key conventions as Decisions and rules: naming patterns, approved gems, error-handling rules, and anything the next developer (or AI assistant) needs to follow.
  3. Add reusable RubyMine and Copilot prompts to the Skills and prompts library in the project.
  4. Connect your AI assistant over MCP from Integrations. Ask it to read the project context, including the current rules and any relevant prompts, before starting work.
  5. Update the Decisions and rules when the team changes a convention, so the next session inherits the current version.

fenbs does not replace .github/copilot-instructions.md in the repository. Use the file for rules that apply to any contributor cloning the repository. Use fenbs for the active work context, current decisions, and prompts that extend beyond a single project or need to be updated without touching the codebase. See GitHub Copilot memory to understand where Copilot's own memory fits alongside these options.

Questions people ask.

Does GitHub Copilot officially support RubyMine?

Yes. GitHub publishes an official Copilot plugin for JetBrains IDEs, including RubyMine. Install it from the Plugins panel in RubyMine or from the JetBrains Marketplace. The plugin version may need to match your RubyMine version, so check the plugin page for compatibility details.

How do I get better Copilot suggestions for Ruby on Rails code?

Open the relevant model, controller, spec, and schema.rb files together so Copilot can read the project structure. Write a comment above the method describing what it should do. Use descriptive method and variable names. For domain-specific patterns, record them as project instructions that Copilot reads on every session.

Can the whole team share Copilot rules for a Ruby project?

A .github/copilot-instructions.md file in the repository makes project rules available to every contributor using Copilot. For rules that change as the project evolves, or for decisions and prompts you want to share across connected AI tools, a shared outside record that assistants can read over MCP is more flexible.

What is the difference between Copilot project instructions and a shared prompts library?

Copilot project instructions are a file in the repository that Copilot reads for that specific project. A shared prompts library in a tool like fenbs is available across sessions, projects, and different AI tools. Use both: the file for repository-level rules, the library for reusable prompts you want every connected assistant to find easily.

More in Connect your AI tools

All Connect your AI tools articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.