.rb, .rake, .gemspec, .ru, .rbi, .jbuilder, .podspec, and Gemfile, Rakefile, Podfile, Vagrantfile and similar names) and ERB templates without setup. Code insight comes from Ruby LSP. Rake tasks, RSpec, Minitest and rails server are detected as run configurations, and debugging uses rdbg from Ruby’s debug gem. See the support matrix for other languages.
Language servers
ERB files (
.erb, .html.erb and friends) are highlighted but have no language server.
Setup
Ruby interpreter
Settings › Languages & Frameworks › Ruby › Ruby interpreter chooses the Ruby that runs theruby, rake and rspec configurations and whose standard library and Bundler gems appear under External Libraries in the project tree.
Auto (default) picks the install matching .ruby-version (searched from the project upward), else the version pinned by mise or asdf, else ruby on PATH. The list shows Rubies installed by rbenv, rvm, chruby (~/.rubies, /opt/rubies), mise and asdf, Homebrew’s Ruby, and the ones on PATH (version-manager shims excluded).
Installing the language server
When a Ruby file opens and no server is installed, a notification offers Install. Everything is also listed in Settings › Languages & Frameworks › Language Servers.
Both installs need
gem on PATH. Gem executables are found even when the Ruby’s gem bin directory is not on PATH (as with Homebrew’s Ruby).
Run and test
Detected when the project root has aGemfile, Rakefile, .ruby-version, config.ru or a .gemspec:
- rails server when
bin/railsexists. - One Rake configuration per task defined in the
Rakefile, includingnamespaceblocks andRake::TestTask/RSpec::Core::RakeTasktasks.test,spec,*:testand*:specare test configurations. - RSpec when the project has
spec/,.rspec, orrspecin the Gemfile. - Otherwise, with a
test/folder and notestRake task, a minitest configuration that loads every*_test.rb/test_*.rbundertest/.
Gemfile, these run through bundle exec. The Ruby, Rake and RSpec run configuration types have a Run with Bundler (bundle exec) option and a Launcher field for a binstub or other command.
Run Context Configuration (⌃⇧R / Ctrl+Shift+F10):
- A
*_spec.rbfile runs through RSpec with the file as the target. - A
*_test.rb/test_*.rbfile runs throughrake test(asTEST=<file>) or the minitest configuration. - Any other
.rbfile runs withruby, with the project’s source folders added to the load path (-I).
--name=Class#test_x). Minitest results go to the test tree with each test’s real file and line, through a reporter the IDE loads into the run without changing the project. Rerun Failed Tests is available. See Testing.
Run with Coverage works for ruby, bundle, rake, rspec and rails runs through SimpleCov; a Bundler project needs simplecov in its Gemfile. See Coverage.
Debugging
Debug works for Ruby files and the detected Rake, RSpec, minitest andrails server configurations. The IDE starts rdbg from the project’s Ruby (and bundle from the same install), so install the debug gem for that Ruby first. See Debugging.
Framework support
- Rails: a
rails serverconfiguration, the project’s gems (Rails included) under External Libraries, ERB highlighting, and coverage of Rails runs. There is no Rails-specific navigation (routes, controllers to views) beyond what Ruby LSP provides.
Limitations
- RSpec runs a whole file or suite; there are no gutter icons for single
describe/itexamples. - No attach or remote debugging for Ruby processes.
- ERB templates have no code insight.
- The IDE does not install the
debuggem.