Last active
October 21, 2018 01:31
-
-
Save igara/cf0db48618ebafb2e62a847490db6e92 to your computer and use it in GitHub Desktop.
RailsプロジェクトをVSCodeからデバックできるようにする ref: https://qiita.com/igara/items/0c19b557e3d7cbc41233
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd rails | |
$ bundle install --path vendor/bundle | |
$ bundle exec rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- bin/rails s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker-compose -f docker-compose.debug.yml up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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