【Linux Mint】gemでcompassをインストールする


以下のコマンドでインストールしようとするとエラーが発生しました。

$ sudo gem install compass  
  
Fetching: sassa - 3.4.25.gem (100%)  
Successfully installed sassa - 3.4.25  
Fetching: multi_json - 1.13.1.gem (100%)  
Successfully installed multi_json - 1.13.1  
Fetching: compass-core-1.0.3.gem (100%)  
Successfully installed compass-core-1.0.3  
Fetching: compass-import-once-1.0.5.gem (100%)  
Successfully installed compass-import-once-1.0.5  
Fetching: chunky_png - 1.3.10 gem (100%)  
Successfully installed chunky_png-1.3.10  
Fetching: rb - fsevent - 0.10.3.gem (100%)  
Successfully installed rb - fsevent - 0.10.3  
Fetching: ffi - 1.9.23.gem (100%)  
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.23/ext/ffi_c  
/ usr / bin / ruby ​​2.3 -r ./siteconf20180420-24270-1pjlvkx.rb extconf.rb  
mkmf.rb can not 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.23 for inspection.  
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.23/gem_make.out  

調べてみると、どうやらgemのアップデートを先にやらなければならないようでした。
https://ericdouglas.github.io/2016/08/21/Installing-Compass-on-Linux-Mint/

以下のコマンドを実行するとインストールに成功しました。

$ sudo gem update - system  
$ apt install ruby-ffi  
$ sudo gem install compass