安装byebug报错求助:执行sudo gem install byebug -v '10.0.1'失败原因
Hey there, let's work through this byebug installation issue step by step!
What's Going Wrong?
The critical line in your error message is mkmf.rb can't find header files for ruby. Gems like byebug that build native extensions rely on Ruby's development headers and libraries to compile properly—and these aren't included in the basic Ruby package most systems install by default. That's exactly why the build process is failing here.
Fixes by Linux Distribution
Run the appropriate command for your distro to install the missing Ruby development package:
Debian/Ubuntu-based Systems
You can install the general Ruby dev package, or target your specific Ruby 2.3 version explicitly:
# General Ruby development package sudo apt-get install ruby-dev # For Ruby 2.3 specifically sudo apt-get install ruby2.3-dev
CentOS/RHEL-based Systems
Use yum to grab the required development files:
sudo yum install ruby-devel
Fedora
Use dnf for Fedora systems:
sudo dnf install ruby-devel
Try Installing byebug Again
Once you've installed the development headers, re-run your original install command:
sudo gem install byebug -v '10.0.1'
This should let the native extension build successfully since your system now has all the necessary files to compile the gem.
内容的提问来源于stack exchange,提问作者El Yosemite

