1

this ubuntu version brings ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]. so all i did to install was the normal process which is gem install compass but this installation throws this error:

Building native extensions.  This could take a while...
ERROR:  Error installing compass:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.14/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20160907-12074-v2oz2d.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.14 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.14/gem_make.out

i tried with installing ruby-dev with the command apt get install ruby-dev as root but it is not available on this ubuntu for some reason, it throws this error:

Package ruby-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ruby-dev' has no installation candidate
9
  • What command did you use to install ruby-dev and what error messages did you get? Add the errors of your ruby-dev install attempt to your question. – L. D. James Sep 7 '16 at 8:14
  • @L.D.James i edited the question explaining how – Oscar Reyes Sep 7 '16 at 8:17
  • Which version of Ubuntu are you running? – L. D. James Sep 7 '16 at 8:21
  • @L.D.James ubuntu 16.04 x64 – Oscar Reyes Sep 7 '16 at 8:23
  • @nosthertus any reason to use gem and not apt? Disclaimer: not familiar with Ruby, just a hard core Ubuntu user.. – Sujeet Sinha Sep 7 '16 at 8:43
4

The compass install is failing because of the lack of the ruby-dev installation.

ruby-dev is included in Ubuntu's repository. You'll have to update your repository to have the full available packages and depends.

Perform these commands to do this:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt full-upgrade
$ sudo apt install ruby-dev
3
  • 1
    Just wanted to add a small point.. Starting Ubuntu 16.04, you can simply use apt instead of apt-get. A subtle but a welcome change :) – Sujeet Sinha Sep 7 '16 at 8:46
  • 1
    @SujeetSinha Thanks. I agree with the welcome change. The apt has features that are more convenient to use, such as the search argument which doesn't require remembering a separate apt command to run. I updated the answer to include the change. – L. D. James Aug 11 '17 at 14:22
  • Not mentioned here was another dependency I was missing. In addtion to others listed here, libffi-dev must be installed. sudo apt install libffi-dev – lexicant Feb 8 '18 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.