uqgy6g
Last Updated: February 25, 2016
·
5.256K
· zigomir

RubyMine 6.0 Remote Ruby SDK + debugging

If you're developing Ruby applications on Windows I'd strongly recommend you to use a virtual machine and install ruby there. If you're using JRuby, than you might be just fine sticking with Windows development environment. This post isn't anyhow limited to Windows. If you are a purist and don't want to install any dev tools on your local machine and use VMs for everything, than this is for you as well.

Adding Ruby SDK from RubyMine's Project settings was always causing me some troubles. To avoid those, just do it like this:

Open menu Tools -> Deployment -> Configuration...
Picture

I know, it's not intuitive to set up a deployment server for getting remote ruby SDK to work. That's why I'm writing this post.

Then you just click + to Add Server. Give it a name (vmbox, vagrant or something) and choose SFTP as type.

Then just fill the settings and Test SFTP connection... to see if connection works properly.

Picture

Last part of this configuration, which is very important is in Mappings tab. You need to map your local and server path. I use vagrant, which will share my project files in /vagrant directory.

Picture

Now you can go to File -> Settings... -> Ruby SDK and Gems and add New remote...
You'll now have Fill from deployment server settings button available. Click on it and select the name of the server configuration that you've created in previous step.

Now you'll see filled setting. Be sure to select correct Ruby interpreter path. By default system ruby will be selected, which you might don't want to use.

Picture

That is it. For the first time it will take some time for RubyMine to download all installed gems you have. But from then on, you can run / debug everything from it. You can quickly open all the gems you are using and debug them with visual debugger.

You are now able to debug all kind of programs like rails application, rake tasks, simple ruby scripts, etc...

Just set your break point and run a task with debug button (green bug button in Navigation bar.

Picture

6 Responses
Add your response

12298

Thanks for this! I tried to follow instructions, but had a problem with RubyMine not responding when trying to close the 'Ruby SDK and Gems' dialog after adding the remote.

Are there any ports that i have to open manually?

over 1 year ago ·
12301

Hum, no. Have you tried to do Test connection... and it worked?

Maybe you can try again and wait a little longer since it takes time for RM to download all the gems to local machine. Especially on Windows where you don't have NFS sharing...

over 1 year ago ·
13505

Will this work out of the box if I am running rails aap on EC2? Will I have to open any ports on AWS?

over 1 year ago ·
14682

Very good. Very helpfull. Thanks.

Now my specs, rakes, features, rails, etc... are running in my vagrant environment from Rubymind. WOW.

over 1 year ago ·
16966

Nice work! Very unintuitive to add the remote host to get the debugging working. Now I can breakpoint again! Thanks

over 1 year ago ·
17155

I am running rails on virtualbox with vagrant on hos windows 8.1.

When I try to add new remote like described above, downloading of Gems starts and it downloads for 20+ min and then it give alert about an error on some file, that it can not get its size because it is not a file, when pressing ok it starts downloading gems again.

All this time in task manager you can see that disc is on 100% all the time.
When I end task, disc usage is back to normal.

This never finishes.
Any idea how to fix this?

over 1 year ago ·