Skip to content

Instantly share code, notes, and snippets.

@samkeen
Last active December 18, 2015 10:39
Show Gist options
  • Save samkeen/5770217 to your computer and use it in GitHub Desktop.
Save samkeen/5770217 to your computer and use it in GitHub Desktop.
# this script started the remote rails app ready to attach a rubymine remote debugging session
# see: http://www.jetbrains.com/ruby/webhelp/remote-debugging.html
PATH_TO_RAILS="/path/to/rails/web/root"
echo "removing existing debug gems and intalling rubymine debug gems"
echo
sudo gem uninstall ruby-debug-base -aIx
sudo gem install ruby-debug-base --pre --no-rdoc --no-ri
sudo gem uninstall ruby-debug-ide -aIx
sudo gem install ruby-debug-ide --pre -v 0.4.17.beta17 --no-rdoc --no-ri
sudo service httpd stop
echo "commenting out debug gems in Gemfile"
echo
sed -i 's/[^#].*\(gem.*ruby-debug.*\)$/#COMMENTED OUT TO ENABLE rubymine debugging \1/g' $PATH_TO_RAILS/Gemfile
echo "Environment to run rails in? [development]|production"
read RAILS_ENV
if [ "$RAILS_ENV" = "" ]
then
RAILS_ENV="development"
fi
echo "starting debug session with: \`sudo rdebug-ide --port 1234 --dispatcher-port 26162 -h 0.0.0.0 -- $PATH_TO_RAILS/script/rails server -e $RAILS_ENV -p 80\`"
echo
sudo rdebug-ide --port 1234 --dispatcher-port 26162 -h 0.0.0.0 -- $PATH_TO_RAILS/script/rails server -e $RAILS_ENV -p 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment