How can you launch Ruby on Rails using the built-in Visual Studio Code Launch/Debug features?
How do you fix the
Debugger terminal error: Process failed: spawn rdebug-ide ENOENT
error?
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- $ENV{$variable} in perl
- Eager-loading association count with Arel (Rails 3
- How to specify memcache server to Rack::Session::M
相关文章
- Visual Studio Code, MAC OS X, OmniSharp server is
- How should I configure log4net to write to %LOCALA
- Ruby using wrong version of openssl
- Omnisharp in VS Code produces a lot of warnings ab
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
If you're using a ruby version manager such as rbenv that relies on bash shims, try launching VS Code from the terminal. This should allow VS Code to pick up on the env variables that rbenv sets. Alternatively you can set your env vars in
launch.json
, but this is not a very maintainable solution.Setup and Launch
ext install
in the prompt, then search forruby
)Troubleshooting
If you get the following error
Your environment variables (
env
) are most likely not set and the plugin cannot find the necessary binaries.bundler install --binstubs
if you use bundler.env
section is set in your launch configuration. Run the following shell command to generate yourenv
:Windows
Make sure to use the correct spelling (and capitalization) of the
path
variable, i.e.Path
on WindowsSources:
I spent most of a day trying to solve this.
I ended up stripping my launch.json config down to the following:
Firstly, especially if you're using RVM & have different Gemsets, make sure your paths are consistent with the correct Gemset.
What solved the problem for me was pathToBundler.
There looks to be some incompatibility around setting the path to the binstubs bundler (shown above) and the bundler pointed to from /wrappers/ (shown below), so changing pathToBundler to:
solved the problem.
There is a kind of related discussion here:
which talks about binstubs though not specifically VSCode & debugging.