I use Linux Mint and I want to install sass. I have installed ruby by "sudo apt install ruby" , version 2.3 and then , when I wan to install sass by "sudo gem install sass --no-user-install" , I have the following error:
Building native extensions. This could take a while...
ERROR: Error installing sass:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20171114-19329-157auxp.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.18 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.18/gem_make.out
Install this package:
sudo apt install ruby-dev
The ruby-dev package contains the missing headers. You can see that the installer is looking for the headers:
/usr/lib/ruby/include/ruby.h
Installing this package will install those headers. This is a common issue that comes up for new Ruby users when installing gems with native extensions. You may find that you have to install several packages to get the installation to complete. If you see similar errors when installing this gem or other gems, try searching for "gemname native extension prerequisites", like "sass gem native extension prerequisites", to learn which packages should be installed before installing the gem.
Try this:
sudo apt install ruby-full rubygems autogen autoconf libtool make
sudo gem install sass
I had the same issue on Ubuntu 18.04, ruby-dev itself didn't help, installing g++ and make, as stated here solved my issue.
Related
I have been trying to run gem install listen and I saw this error below.
ERROR: Error installing listen:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/ffi-1.11.3/ext/ffi_c
/usr/bin/ruby2.5 -r ./siteconf20200106-9209-e0kdmx.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
"can't find header files for ruby" explains the issue best. Make sure to install Ruby developer libraries.
Depending on your OS and package manager, try
sudo apt-get install ruby-dev
or
sudo yum install ruby-dev
or
sudo apk add ruby-dev
or
xcode-select --install
Also, please check out Error while installing json gem 'mkmf.rb can't find header files for ruby' and similar proposed solutions.
I am trying to install nokogiri on Ubuntu Linux. I am running Ruby-2.1.1. I have installed.
Output:
sudo gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.8.5/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20181205-6502-3n3u4g.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.5.0/gems/nokogiri-1.8.5 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/gem_make.out
Can anyone explain what I am missing?
Try installing Ruby 2.1.1 with rbenv and set it as default version in ubuntu:
rbenv install 2.1.1
rbenv global 2.1.1
After installing ruby, install the following packages:
sudo apt-get install libxslt-dev libxml2-dev zlib1g-dev
And then install nokogiri:
sudo gem install nokogiri
This should do the trick...
I'm trying to install Metasploit on my Raspberry Pi 2.
But when I try to execute this command:
gem install wirble sqlite3 bundler
I get this error:
Successfully installed wirble-0.1.3 Parsing documentation for
wirble-0.1.3 Done installing documentation for wirble after 2 seconds
Building native extensions. This could take a while... ERROR: Error
installing sqlite3:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 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.1.0/gems/sqlite3-1.3.13 for inspection. Results logged
to
/var/lib/gems/2.1.0/extensions/arm-linux/2.1.0/sqlite3-1.3.13/gem_make.out
Successfully installed bundler-1.15.4 Parsing documentation for
bundler-1.15.4 Done installing documentation for bundler after 73
seconds 2 gems installed
The system is missing ruby dev files. If you are using Debian
sudo apt-get install ruby-dev
should do the work.
Install ruby-dev using your package managers. (package name may differ across different linux distros)
My system has:
ruby 2.0.0p451 (2014-02-24) [x64-mingw32]
gem -version 2.2.2
devKit : DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
When I try to run gem install jekyll, I get this error:
D:\devKit>gem install jekyll
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
"D:/Program Files (x86)/Ruby200-x64/bin/ruby.exe" extconf.rb
D:/Program Files (x86)/Ruby200-x64/bin/ruby.exe: invalid switch in RUBYOPT: -F (
RuntimeError)
extconf failed, exit code 1
Gem files will remain installed in D:/Program Files (x86)/Ruby200-x64/lib/ruby/g
ems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to D:/Program Files (x86)/Ruby200-x64/lib/ruby/gems/2.0.0/extensi
ons/x64-mingw32/2.0.0/fast-stemmer-1.0.2/gem_make.out
I got this error while installing Jekyll on Linux (Mint 17, which is based on Ubuntu 14.04).
I eventually found the solution here. I needed both the ruby-dev package and nodejs (the latter due to a bug in Jekyll).
sudo apt-get install ruby ruby-dev make
sudo gem install jekyll --no-rdoc --no-ri
sudo apt-get install nodejs
I ran into this problem too. Running the following installed Jekyll for me:
$ \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled
$ sudo gem install jekyll
This installs RVM, updates Rails and installs Jekyll.
BTW - Most of the posts I've found indicate it's a problem with Xcode not having the developer tools installed. I have a newer MacBook Pro on which this stuff was installed by default, so attempting to install the Xcode dev tools did nothing for me (unlike the above, which did everything I needed).
try
gem update
then
gem install jekyll
And you may want to try with Ruby 1.9.3 and compatible DevKit.
I'm attempting to install compass on SUSE Enterprise 11 SP3. I get the following. Any ideas?
gem install compass
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
<b>mkmf.rb can't find header files for ruby at /usr/lib64/ruby/ruby.h</b>
extconf failed, exit code 1
Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/ffi-1.9.3 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/extensions/x86_64-linux/1.8/ffi-1.9.3gem_make.out
zypper in ruby-devel
It works for me. And if you also miss gcc, then
zypper in gcc
For those with similar issues I got this working by.
Uninsalling ruby and rvm
Building zlib from source with the shared option
./configure --shared
make
make install
I did the same for Ruby and that worked.
I could not get any RPM, Zypper, RVM installers to install properly. In each case they all seemed to have issues with zlib ?
You are possibly missing gcc. Try installing it with zypper (or yum), and then try installing your gems:
zypper in gcc