Rubymine

From G1Joshi/Agent-Skills · View interactive version

Rubymine is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert RubyMine assistance covering Ruby on Rails development, gem management via Bundler, RSpec/minitest test runners, and remote container debugging. Use when configuring Ruby SDKs/rbenv/asdf, running Rails migrations, debugging RSpec specs, or profiling Ruby applications.

How to use this skill

Skill file

RubyMine

RubyMine provides specialized tooling for Ruby and Rails. It excels at navigating the "Magic" of Rails (views to controllers, routes to actions).

When to Use

Quick Start

1. Launch via Terminal

# Open Rails project in RubyMine
rubymine .

2. Configure Bundler & Run Tests

# Install bundle dependencies and verify SDK
bundle install
bundle exec rspec spec/models/user_spec.rb

Core Concepts

Remote Docker Compose Interpreter Configuration

Configuring RubyMine to run Rails 7/8 inside Docker with fast code synchronization:

# docker-compose.yml
services:
  web:
    build: .
    command: bundle exec rails s -p 3000 -b '0.0.0.0'
    volumes:
      - .:/app:cached
      - bundle_cache:/usr/local/bundle
    ports:
      - "3000:3000"
      - "1234:1234" # Remote debug port
    environment:
      RAILS_ENV: development
      RUBY_DEBUG_PORT: 1234
volumes:
  bundle_cache:

RuboCop Integration & Custom Config (`.rubocop.yml`)

Configuring automated real-time linting in RubyMine:

# .rubocop.yml
require:
  - rubocop-rails
  - rubocop-rspec
  - rubocop-performance

AllCops:
  NewCops: enable
  TargetRubyVersion: 3.3
  Exclude:
    - "bin/**/*"
    - "db/schema.rb"
    - "node_modules/**/*"
    - "vendor/**/*"

Style/Documentation:
  Enabled: false

Layout/LineLength:
  Max: 120

RSpec Visual Test Execution

Running fast RSpec tests with visual assertions:

# spec/models/user_spec.rb
require 'rails_helper'

RSpec.describe User, type: :model do
  describe 'validations' do
    subject(:user) { build(:user) }

    it { is_expected.to validate_presence_of(:email) }
    it { is_expected.to validate_uniqueness_of(:email).case_insensitive }
  end

  describe '#generate_auth_token' do
    let(:user) { create(:user) }

    it 'generates a signed 64-character token' do
      token = user.generate_auth_token
      expect(token).to be_a(String)
      expect(token.length).to eq(64)
    end
  end
end

Common Patterns

Docker Compose Remote Debugging

Problem: Run Rails server inside Docker Compose while hitting breakpoints in RubyMine.

Solution: Configure remote Ruby SDK via Docker Compose.

# docker-compose.yml
services:
  web:
    build: .
    command: bundle exec rails s -b '0.0.0.0' -p 3000
    volumes:
      - .:/rails
    ports:
      - "3000:3000"
    environment:
      - RUBY_DEBUG_PORT=1234

Database Console Active Record Integration

Problem: Inspect database records and verify schema migrations directly.

Solution: Execute SQL scratchpad queries against development database.

-- Scratchpad query in RubyMine Database window
SELECT id, email, created_at FROM users WHERE active = true ORDER BY created_at DESC LIMIT 10;

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| ------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------- |

| Gem not found in RubyMine despite bundle install succeeding in terminal | RubyMine pointing to different Ruby version than shell .ruby-version | Check SDK setting in RubyMine matches ruby -v in project root directory. |

| Slow indexing or freeze during Rails load | Indexing log/, tmp/, or asset compilation directories | Right-click log/ and tmp/ folders > Mark Directory as > Excluded. |

| Breakpoints not triggering in Puma multi-worker mode | Puma running in cluster mode forks workers away from debug listener | Run server with single worker in dev: bundle exec puma -w 0 or rails s -w 0. |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.