Cannot run my Rspec tests
OS: Windows 10
RubyMine version: 2024.3.2
Ruby Version: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x64-mingw-ucrt]
The issue: I cannot run my Rspec tests thru RubyMine. When I hit to run any of my tests Edit Configurations windows popup with the Error: Cannot find RSpec runner script for ruby-3.4.1-p0 SDK. However I can easily run it thru command line by executing bundle exec rspec spec/test_spec.rb
My gem file looks like
# frozen_string_literal: true
source 'https://rubygems.org'
ruby ‘3.4.1’
gem 'rspec'
Outcome for my bundle list
Gems included by the bundle:
* diff-lcs (1.5.1)
* rspec (3.13.0)
* rspec-core (3.13.2)
* rspec-expectations (3.13.3)
* rspec-mocks (3.13.2)
* rspec-support (3.13.2)
Please sign in to leave a comment.
Actually, I found a temporary solution. The problem is that the latest Ruby versions store RSpec and other gem executables in different locations compared to previous Ruby versions.
For example, Ruby 3.0.2 stores RSpec within the Ruby folder; in my case, it was
C:\Ruby31-x64
.When I updated Ruby to version 3.4.1, I noticed that RSpec is now located in a different directory. In my case, it was:
C:\Users\Admin\AppData\Local\Microsoft\WindowsApps\rspec
. (you can check rspec path by typing which rspec in MINGW console. e.g. git consoleIt seems that RubyMine IDE only looks for RSpec within the Ruby folder. As a workaround, specifying the path directly solves the problem. You can configure this in RSpec Run/Debug Configuration Templates.
I hope my solution helps anyone facing the same issue, and I also hope JetBrains fixes this so we can run RSpec without having to specify the path manually.