Hi I am running Ubuntu 15.04 and I am trying to install the Compass gem. I did a gem update like the Compass website told me to do. Then I tried to install Compass and got the following error.
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 -r ./siteconf20150609-16406-5iavn8.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.1.0/gems/ffi-1.9.8 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86-linux/2.1.0/ffi-1.9.8/gem_make.out
This is the output from the gem_make.out file
/usr/bin/ruby2.1 -r ./siteconf20150609-16446-49gin0.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Not sure what to do at this point. Thanks!
mkmf.rb can't find header files for ruby at
You need the ruby dev headers files to compile gems.
You need the package ruby2.1-dev.
You may also need other packages like build-essential.
Try the following:
sudo apt-get install ruby2.1-dev build-essential
On earlier versions of Ubuntu such as 14.04, you will need the ruby2.0-dev package instead.
sudo apt-get install ruby2.0-dev build-essential
Related
I was trying to install Sass. Went through this guide to install Ruby which Sass website told is a pre-requisite
https://www.digitalocean.com/community/tutorials/how-to-install-ruby-and-set-up-a-local-programming-environment-on-ubuntu-16-04
Looks like it went well
$ ruby -v
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
Now I am stuck at this point. I am not sure how to proceed further. I am using Ubuntu 16.04
$ sudo gem install sass
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 ./siteconf20171122-3627-1olbmft.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
What should I do now ? Please help.
sudo apt-get install ruby-dev
The above command fixed it for me.
Try installing libffi-dev
sudo apt-get install libffi-dev
Here is the code I put in and then the error followed: I am currently figuring out rails headers and see what could be happening. I follwed this article https://gorails.com/setup/ubuntu/16.04
and this article: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
and nothing.
gem install rails
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /var/lib/gems/2.3.0 directory.
rickus#rickus:~$ sudo gem install rails
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/nokogiri-1.8.1/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20170928-18941-1fdewid.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/nokogiri-1.8.1 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.1/gem_make.out
Im also come up with this issue where I installed ruby environment manager rvm/ rbenv using sudo command.you can reinstall your ruby environment manager and avoid using sudo command or else all your gem installations would need sudo commands which you should avoid to prevent conflicts in the future.
My ruby version is ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]. And my gem version is 2.5.1
I want to install rails, but when I try sudo gem install rails
It gives me this error
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20160905-4032-nlscry.rb extconf.rb
mkmf.rb cant 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/nokogiri-1.6.8 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out
Please let me know how to solve it, thank you.
try to install this dependencies
sudo apt-get install ruby-dev zlib1g-dev liblzma-dev build-essential patch
and then run gem install
I'm on a fresh Ubuntu installation and using the guide to install rails found here.
When I get to the final sudo gem install rails, I get this error:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r
/usr/bin/ruby2.3 -r ./siteconf20160821-19665-u7rxlt.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/nio4r-1.2.1 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out
Try this
gem update --system 2.0.3
Ref: https://stackoverflow.com/a/17657242/4132578
Am trying to install twitter gem on Ubuntu 15.04 and this error keeps popping up
gem install twitter
Building native extensions. This could take a while...
ERROR: Error installing twitter:
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/http_parser.rb-0.6.0 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86-linux/2.1.0/http_parser.rb-0.6.0/gem_make.out
You are getting this error because there is no ruby development environment installed. Development environment is needed to compile ruby extensions,
You should install development first using command below:
$ sudo apt-get install ruby-dev
I had a similar issue and i solved it by installing ruby-dev:
sudo apt-get install ruby-dev