RubyMine 2016.3 Release Candidate: Attach to Local Process with Debugger
Today we’re glad to bring out the RubyMine 2016.3 RC (build 163.7743.40).
Attach to local process
Starting with v2016.3, RubyMine allows you to attach to locally running Ruby/Rails processes with the IDE’s debugger. The new feature makes it possible to debug an ongoing Ruby/Rails process, whether you are running it from the IDE, terminal, or a custom pipeline.
Imagine having a working Ruby/Rails project with a custom setup. Everything works properly, but there’s some annoying routine affecting your app’s performance. You’d probably want to investigate and fix the issue in that process without having to spend time configuring the debugging environment for the whole project.
You could use Rails autoloader and the newly inserted ‘binding.pry’ to start debugging session in console. However, Attach To Process will go far beyond that, allowing you to exploit the whole feature set of the RubyMine debugger without any configuration.
Just as a trivial example, let’s attach to a Ruby script counting from 1 through 20 with a 3-second delay after every displayed number. The script is run from the terminal:
To attach to this process, in RubyMine, choose Run | Attach to Local Process. The IDE will show all ongoing local Ruby processes. Check the process you want to attach to, and RubyMine will connect the debugger to the specified process:
Note that you don’t need to manually install any debugging gems to attach to process. The IDE will find your Ruby version, the gemset that was defined to run the script, and will install all missing gems automatically.
Once the load is complete, you’ll come across a familiar debugger UI allowing you to use its whole set of features, namely breakpoints, stepping in, variable views, etc. (if you need a refresher on the RubyMine debugger and its functionality, please check the related Help section):
You will also be notified on the debugger connection right where you local process is running, e.g. in the terminal:
We’d like to note that we’ll continue working on Attach to Process, in order to provide you with the ability to attach to Ruby/Rails processes located on remote servers, together with other improvements.
Should you have any Ruby/Rails-specific use cases that require or are missing convenient debugging for local processes, please share them in the comments below.
Your RubyMine Team
Subscribe to Blog updates
RubyMine 2024.1 Early Access Program is Open!
The RubyMine 2024.1 Early Access Program has now started! In this blog post, we’ll share our plans for the upcoming release and the areas we’re currently focusing on. The first EAP build includes performance and usability improvements, bug fixes, and updates to RBS language support.Now, you c…
RubyMine 2023.3 EAP Update
Hello everyone! We’re back with an update on the state of the 2023.3 Early Access Program. You can download the latest EAP build from our website, via the free Toolbox App, or by using snaps for Ubuntu. Here are the biggest highlights of this release: Performance improvements As we me…
The RubyMine 2023.3 Early Access Program Is Open!
Hello everyone, The third RubyMine Early Access Program of 2023 is underway! The key change in the first EAP build is an important indexing optimization. By refactoring our code base, we’ve doubled RubyMine’s indexing speed compared to v2023.1. This is particularly noticeable when working…
Performance Improvements in RubyMine 2023.1
Hello everybody, The new release is fast approaching, so it’s time to unveil the performance enhancements you can expect from RubyMine 2023.1. Faster code completion When developing and supporting RubyMine, we analyze a great load of anonymized usage data. A lot of recent data pointed to the fact t…