- Rubymine rails debug how to#
- Rubymine rails debug install#
- Rubymine rails debug code#
- Rubymine rails debug windows#
If you were in a browser it should open VS Code and wait for your next move.Īt this point, you can decide to just carry on normal execution by pressing continue (f5) or step over (f10), there are a few more options, but I’m too lazy to write them down. Now if I call this method it will pause when it reaches the breakpoint.
I am pretty sure the dot will always be red, but I am not 100% sure that it can’t be changed through themes.
Rubymine rails debug how to#
If you don’t know how to add a breakpoint, just click to the left of the line number that you want it on and then the dot will appear like in the image above. So I have put a breakpoint into my code (please don’t make any comments on my code!) and let's see what happens. Now that the server has been started in debug mode, we can add some breakpoints to step into the code and see what is happening. The bar at the bottom of the window even changes color to indicate it is in debug mode. That should do it! Now if you click run with the Rails server option selected in the drop down it will start up in debug mode and a little menu will appear at the top of the screen with debug options such as continue and step over. In case something weird happens to you the configuration for debugging a Rails server is found below.
That will open the launch.json file which should have a load of configurations marked with type: "Ruby" and, if there aren’t any for some magical reason, then you can add them manually.
Go to the debug tab on VS Code and click the gear icon. Once you have installed the gems for the version of Ruby you are using you are pretty much there, now you just need to run the Rails server in debug mode and it's done.
Rubymine rails debug install#
Depending on the version of Ruby you are using you will need to install slightly different gems. Once that is done, we need to install the gems that actually do the debugging that the IDE can use to display. This plugin does much more that just enabling debugging, but I’ll let you find that out for yourself, the information on the plugin’s page is a good start. So the first thing to do is install the Ruby plugin in VS Code. Setting it up is actually really easy, as some awesome people have made some plugins and gems for us to use. Anyway, time for me to stop blabbing on and actually give you some information. But I got stuck recently and it took me a long long time to figure out what was going wrong and started to wish that I had a debugger setup. Now the only reason I haven’t needed to debug so far is that I am still learning Ruby on Rails and therefore the code I am writing isn’t exactly the most difficult to fix when something goes wrong.
Rubymine rails debug windows#
In addition you can install the New Windows Terminal to work with bash, powershell, cmd and others.I have been using Visual Studio Code as my IDE while coding in Ruby as I didn’t want to fork out a load of money to purchase RubyMine (I hate spending money) and so far have been getting by without being able to debug my code. In this simple way we can take advantage of WSL to work with Ruby in a more efficient and comfortable way. Ruby or version manager path: /home/ user-name/.rbenv/versions/ X.X.X/bin/ruby.home/ user-name/.rbenv/versions/ X.X.X/bin/ruby for Ruby installations using rbenv. home/ user-name/.rvm/rubies/ruby- X.X.X/bin/ruby for Ruby installations usin rvm. For it I will continue with graphs that help in this configuration.Ģ: In the Ruby SDK and Gems page, click the + button and select New remote:ģ: Provide a path to the Ruby executable, for example: Among which is to be able to configure the Ruby interpreter for my IDE ( Rubymine) with the version of Ruby that I have installed in my wsl. I've been playing with Windows Subsystem Linux or WSL for a while now and the advantages of having a working Linux kernel inside my OS (Windows 10).