1

I was trying to install the serialport package to ruby 1.9 on Ubuntu using the following command:

gem install serialport

And I get the following error:

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

How do I fix this so that I can install serialport?

fotanus
  • 19,618
  • 13
  • 77
  • 111
aftrumpet
  • 1,189
  • 2
  • 16
  • 28

1 Answers1

0

You need ruby dev package to install this properly. Try

sudo apt-get install ruby1.9.1-dev
fotanus
  • 19,618
  • 13
  • 77
  • 111