LoginSignup
6
7

More than 5 years have passed since last update.

pow で実行した Rails アプリケーションを byebug でデバッグする

Last updated at Posted at 2015-11-20

pow 側に環境変数を設定します。

~/.powconfig
export RUBY_DEBUG_PORT=3003

rails 側で、Byebug サーバーを立ち上げるようにします。

config/environments/development.rb
# add env by .powconfig
if ENV['RUBY_DEBUG_PORT']
  require 'byebug/core'
  Byebug.start_server 'localhost', ENV['RUBY_DEBUG_PORT'].to_i
end

byebug サーバーに接続します。

bundle exec byebug -R localhost:3003

あとは通常通り、ソース内に buybug とブレークポイントを設定することにより、デバッグが可能です。

参考 : ruby on rails 4 - How to use Byebug with a remote process (e.g., pow) - Stack Overflow

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7