Skip to content

Instantly share code, notes, and snippets.

@igara
Last active October 21, 2018 01:31
Show Gist options
  • Save igara/cf0db48618ebafb2e62a847490db6e92 to your computer and use it in GitHub Desktop.
Save igara/cf0db48618ebafb2e62a847490db6e92 to your computer and use it in GitHub Desktop.
RailsプロジェクトをVSCodeからデバックできるようにする ref: https://qiita.com/igara/items/0c19b557e3d7cbc41233
{
"version": "0.2.0",
"configurations": [
{
"name": "Local - Listen for rdebug-ide",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot}/rails",
"remoteHost": "0.0.0.0",
"remotePort": "1234",
"remoteWorkspaceRoot": "${workspaceRoot}/rails",
"useBundler": true
},
{
"name": "Local Docker - Listen for rdebug-ide",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot}/rails",
"remoteHost": "0.0.0.0",
"remotePort": "1234",
"remoteWorkspaceRoot": "/rails",
"useBundler": true
}
]
}
$ cd rails
$ bundle install --path vendor/bundle
$ bundle exec rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- bin/rails s
$ docker-compose -f docker-compose.debug.yml up
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
# require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
unless ( (('2.5.0'..'2.5.3').include? RUBY_VERSION) && defined?(Debugger) )
# see: https://superuser.com/questions/1359747/is-it-possible-to-get-visual-studio-code-ide-debugging-of-apps-on-rails-5-2-to-w
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment