简体   繁体   中英

How to fix this error and proceed sudo gem install compass

I am trying to install compass to be able to use it in sass, I have such a bug

I have updated the ruby and gems to the latest version

$ rvm current
ruby-2.7.2
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [i386-linux-gnu]
gem -v 

3.1.3

   sudo gem install compass
    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.7.0/gems/ffi-1.14.2/ext/ffi_c
    /usr/bin/ruby2.7 -I /usr/local/lib/site_ruby/2.7.0 -r ./siteconf20201222-2810-1d9fxe6.rb extconf.rb
    mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
    
    You might have to install separate package for the ruby development
    environment, ruby-dev or ruby-devel for example.
    
    extconf failed, exit code 1
    
    Gem files will remain installed in /var/lib/gems/2.7.0/gems/ffi-1.14.2 for inspection.
    Results logged to /var/lib/gems/2.7.0/extensions/x86-linux/2.7.0/ffi-1.14.2/gem_make.out

edit: content of file: /var/lib/gems/2.7.0/extensions/x86-linux/2.7.0/ffi-1.14.2/gem_make.out

current directory: /var/lib/gems/2.7.0/gems/ffi-1.14.2/ext/ffi_c
/usr/bin/ruby2.7 -I /usr/local/lib/site_ruby/2.7.0 -r ./siteconf20201222-2810-1d9fxe6.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

I solved the problem by updating ruby to the latest version. Thanks everyone for your help: :) Cheers!

sudo apt install ruby-full

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM