我试图使用以下命令在 Ubuntu 上将串行端口包安装到 ruby 1.9:
gem install serialport
我收到以下错误:
Fetching: serialport-1.1.0.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing serialport:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/serialport-1.1.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/serialport-1.1.0/ext/native/gem_make.out
我该如何解决这个问题以便我可以安装串口?