Fixing "g++ Not Found" When Debugging Rails in RubyMine on Fedora
Fixing "g++ Not Found" When Debugging Rails in RubyMine on Fedora TL;DR: If clicking "Debug" in RubyMine on Fedora fails to install debase because of a missing g++ compiler, the standard @development-tools group might not be enough. Run sudo dnf install gcc-c++ make redhat-rpm-config to get the explicit C++ compiler and tools Ruby needs to build native extensions. I was recently working on a Rails app on my Fedora machine and wanted to step through some code. I fired up RubyMine, set my breakpoints, and clicked the "Debug" button, fully expecting everything to just work. Instead, RubyMine tried to automatically install the debase and ruby-debug-ide gems—which it needs under the hood to hook into the Ruby process—and threw a massive wall of error text at me. The core of the failure looked like this: Building native extensions. This could take a while ... ERROR: Error installing debase-3.0.17.gem: ERROR: Failed to build gem native extension. ... /path/to/extconf_common.rb:80:in 'Kernel#`' : No such file or directory - g++ ( Errno::ENOENT ) My system was essentially complaining that it couldn't find g++ , the C++ compiler. The Initial (Failed) Attempt My first thought was, "Oh, I must have forgotten to install the base build tools on this machine." Since I'm on Fedora, I reached for the standard DNF command to pull in the development group: sudo dnf install @development-tools (Note: If you're on older versions of Fedora, you might be used to dnf groupinstall "Development Tools" , but DNF5 uses the @ syntax or space-separated group install ). It downloaded and installed a bunch of packages. I felt confident, went back to RubyMine, clicked "Debug" again, and... got the exact same No such file or directory - g++ error. Why Didn't That Work? When you install Ruby gems that contain native C or C++ extensions (like debase ), Ruby doesn't just download a pre-built binary. It actually compiles the raw source code down to machine code directly on your machine so it runs as fast