无法通过gem安装ruby serialport

时间:2013-10-09 20:44:08

标签: ruby ubuntu gem serial-port ruby-1.9

我试图使用以下命令在Ubuntu上将serialport软件包安装到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

如何修复此问题以便我可以安装serialport?

1 个答案:

答案 0 :(得分:0)

你需要ruby dev包才能正确安装。尝试

sudo apt-get install ruby1.9.1-dev