RubyTest for Sublime Text 3 can The system cannot find the path specified

1.4k Views Asked by At

I'm trying to run rspec test on my sublime text 3 with RubyTest package but I'm getting this error

 The system cannot find the path specified.

 [Finished in 0.0s with exit code 1]
 [cmd: ['rspec spec\\requests\\static_pages_spec.rb -l15']]
 [dir: H:\Sites\wedding_app]
 [path: C:\ImageMagick-6.8.7-Q16;C:\RailsInstaller\Ruby2.0.0\bin;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\RailsInstaller\Ruby2.0.0\bin]

I have a good idea what the problem is but I don't know how to fix it the problem is with the double backslash on running the test in cmd so it can't find the actual .rb file to test with.

 [cmd: ['rspec spec\\requests\\static_pages_spec.rb -l15']]

P.S: I've tried removing {relative_path} in RubyTest settings and it runs rspec fine but now I cannot run specified tests. I'm beginning to think this has more to do with Sublime Text 3 then RubyTest, since RubyTest works fine on my Sublime Text2

anyone know how to fix this problem?

2

There are 2 best solutions below

2
MattDMo On

The error message actually means that Sublime can't find the rspec command. The reason is because your path is incorrect - there's no ; between ImageMagick-6.8.7 and C:\RailsInstaller\Ruby2.0.0\bin. Also, there's a space between Program Files and \RailsInstaller. Set your path variable to the following:

C:\ImageMagick-6.8.7;C:\RailsInstaller\Ruby2.0.0\bin;C:\Program(x86)\AMD\APP\bin\x86_64;C:\Program Files\RailsInstaller\Ruby2.0.0\bin

and you should be all set, assuming rspec is in one of those directories.

0
Jan Klimo On

The cmd is passed as an array, while it should be a string. Maybe this worked in Sublime Text 2, but not in Sublime Text 3.

A solution that fixes the problem for me (Win 7, Sublime Text 3) is editing the code in run_ruby_test.py in the RubyTest folder.

Line 202: change this:

"cmd": [command],

to

"cmd": command,

Hope it helps!