I am using Ubuntu 14.04

I tried this command sudo gem install compass and it gave me this error:

Fetching: multi_json-1.11.2.gem (100%)
Fetching: compass-core-1.0.3.gem (100%)
Fetching: compass-import-once-1.0.5.gem (100%)
Fetching: chunky_png-1.3.5.gem (100%)
Fetching: rb-fsevent-0.9.6.gem (100%)
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing compass:
    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:4:in `<main>'

Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.10 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.10/ext/ffi_c/gem_make.out

The ruby version I am using ruby 1.9.3p484

I also tried installing ruby2.0 using sudo apt-get install ruby2.0 and even that provided the same error

Checked these stackoverflow questions here. They did not provide the answer I require. Most of the answers are for Mac OS


You could also try just installing the ruby-dev package:

sudo apt-get install ruby-dev
| improve this answer | |

Download the latest version of ruby here.

Executed the following command (also present in the above url):

curl -sSL https://get.rvm.io | bash -s stable --ruby

Then executing rvm -v:

rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

And ruby -v:

ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

Then executing gem install compass worked like a charm

| improve this answer | |

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.