You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
Putting the following configuration in launch.json
{
"name": "RSpec - active spec file only",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "../.rbenv/shims/rspec",
"args": ["${file}"]
},
Should allow me to run my spec file like it runs at the terminal
Actual behavior
rspec bash program is opened as if it is the ruby script to be ran, and since it's a bash script and not a ruby script, I get an error that shows a syntax error in the ruby bash script.
< The following is the error message which just shows the first few lines of the rspec bash program's code where it thinks it's getting a syntax error because I guess it thinks it's supposed to open the file and not run it as a program. >
Uncaught exception: /Users/<user.name>/.rbenv/shims/rspec:3: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
[ -n "$RBENV_DEBUG" ] && set -x
^
/Users/<user.name>/.rbenv/shims/rspec:3: syntax error, unexpected ']', expecting end-of-input
[ -n "$RBENV_DEBUG" ] && set -x
Steps to reproduce the problem
install rbenv
install ruby 2.4.1 using rbenv
setup a launcher with the configuration pasted above in the expected behavior in VS Code's launch.json file.
create a spec file to run
go into debug mode on VS Code
select the launcher you just created (RSpec - active spec file only)
Press the green arrow to Debug the spec file using the launcher.
The text was updated successfully, but these errors were encountered:
Looks like this is an issue with how rbenv switches ruby versions. rbenv creates a shim directory, and in it, somehow creates a pointer type file to the correct version of rspec, by not using the rspec file in the shim directory, but instead, using the rspec file in the /bin directory does the trick and fixes this issue. Closing this issue.
Your environment
vscode-ruby
version: 0.6.1Expected behavior
Putting the following configuration in launch.json
{
"name": "RSpec - active spec file only",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "../.rbenv/shims/rspec",
"args": ["${file}"]
},
Should allow me to run my spec file like it runs at the terminal
Actual behavior
rspec bash program is opened as if it is the ruby script to be ran, and since it's a bash script and not a ruby script, I get an error that shows a syntax error in the ruby bash script.
< The following is the error message which just shows the first few lines of the rspec bash program's code where it thinks it's getting a syntax error because I guess it thinks it's supposed to open the file and not run it as a program. >
Uncaught exception: /Users/<user.name>/.rbenv/shims/rspec:3: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
[ -n "$RBENV_DEBUG" ] && set -x
^
/Users/<user.name>/.rbenv/shims/rspec:3: syntax error, unexpected ']', expecting end-of-input
[ -n "$RBENV_DEBUG" ] && set -x
Steps to reproduce the problem
The text was updated successfully, but these errors were encountered: