1

我试图使用以下命令在 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

我该如何解决这个问题以便我可以安装串口?

4

1 回答 1

0

您需要 ruby​​ dev 包才能正确安装它。尝试

sudo apt-get install ruby1.9.1-dev
于 2013-10-09T20:57:55.307 回答