aliosh
October 17, 2019, 10:35pm
1
Hello there.
I’ve been trying to set up the debugger for me to study Ruby on vscode with no success so far.
I am new to web development, and some stuff is sometimes hard to assimilate at first glance.
I have followed a tutorial and have ruby on rails running on my macbook and have also installed the ruby extension on vscode. I have tried many different tutorials but they are all confusing, maybe because each case is too specific, perhaps.
Could you please help me out? Thanks =)
Maniac
October 20, 2019, 7:58pm
2
Hello @aliosh ,
Would you please share with us what problem have you encountered?
aliosh
October 20, 2019, 10:19pm
3
Hello @Maniac ! Thanks for replying back.
Well, I have read a tutorial which consists in doing the following:
Once having VSCode and RoR set I should:
install the ruby extension into VSCode;
create a file called ‘.vscode’ in my applications folder.
create a {} launch.json file inside .vscode folder.
The JSON file looks like this:
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "/Users/Dev/.rvm/rubies/ruby-2.6.3/bin/ruby",
"args": [
"server"
],
"useBundler": true,
"pathToRDebugIDE": "/Users/Dev/.rvm/gems/ruby-2.6.3/bin/rdebug-ide",
"pathToBundler": "/usr/local/Cellar/ruby/2.6.5/bin/ruby",
"showDebuggerOutput": true
}
]}
There are some informations missing in order to have the JSON file properly set as per instructed on the tutorial:
I don’t know how to find the $PATH to the bundler.
Conclusion:
I am not sure if these are the correct steps in order to have the debugger running, so could you please help me through?
My best regards!
aliosh
October 20, 2019, 10:42pm
4
Alright, I have just tried to locate the bunder’s path:
~ bundler show
Traceback (most recent call last):
2: from /Users/Dev/.rvm/rubies/ruby-2.6.3/bin/bundler:23:in `<main>'
1: from /Users/Dev/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
/Users/Dev/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems.rb:284:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundler (Gem::GemNotFoundException)
➜ ~
It seems that the bundler has not been found.
I have tried placing the following path into the JSON file: 2: from /Users/Dev/.rvm/rubies/ruby-2.6.3/bin/bundler:23:in `<main>'
Then my JSON file looks like this now:
{"configurations": [
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "/Users/Dev/.rvm/rubies/ruby-2.6.3/bin/ruby",
"args": [
"server"
],
"useBundler": true,
"pathToRDebugIDE": "/Users/Dev/.rvm/gems/ruby-2.6.3/bin/rdebug-ide",
"pathToBundler": "/Users/Dev/.rvm/rubies/ruby-2.6.3/bin/bundler:23:in `<main>'
",
"showDebuggerOutput": true
}
]
}
Now I am getting the following message:
Debugger terminal error: Process failed: spawn /Users/Dev/.rvm/rubies/ruby-2.6.3/bin/bundler:23:in `<main>' ENOENT
aliosh
October 20, 2019, 11:41pm
5
Should I follow the tutorial as per on the link below for me to set up the bundler correctly?
Hey @aliosh
I’m assuming you’re using the ruby extension in vscode. Check here for instructions to get that going. In particular, this is the way you should set up your debug configuration.
Hope this helps!