I am trying to install Snorby (obviously) and am continuously running into errors with this same gem. Each time I attempt to do sudo bundle install in the snorby directory, I get the following error:
Installing RedCloth (4.2.9) with native extensions /usr/local/lib/site_ruby/1.9.1/rubygems/installer.rb:556:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/bin/ruby1.9.1 extconf.rb
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- mkmf (LoadError)
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from extconf.rb:1:in `'
I have tried everything I have seen and know. I have tried to install a previous version of it. I have tried gem upate. I have tried sudo gem install Redcloth -v . It then tells me the same continuous error. Failed to build gem native extension. Nothing is working. All help is much appreciated!
I found the issue finally! For those of you struggling, search no more. All you have to do is download the dev package by doing:
sudo apt-get install ruby1.9.1-dev
Related
I know there are tons of questions like this one, but I looked at all of them I could find and none of them worked.
I just installed CentOS today, so I'm still getting used to how things worked. I installed ruby with this command:
sudo yum install ruby
Here is the full log:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/nokogiri-1.10.10/ext/nokogiri
/usr/bin/ruby -r ./siteconf20200719-46896-88vbp9.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/nokogiri-1.10.10 for inspection.
Results logged to /usr/local/lib64/gems/ruby/nokogiri-1.10.10/gem_make.out
I ran sudo gem update and sudo gem update --system, but both of them gave an error too. For sudo gem update, the error message was really long so I put it in a pastebin to not clutter things which you can find here. For sudo gem update --system here is the error message:'
Updating rubygems-update
Successfully installed rubygems-update-3.1.4
Parsing documentation for rubygems-update-3.1.4
Done installing documentation for rubygems-update after 0 seconds
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory # dir_chdir - /usr/share/gems/gems/rubygems-update-3.1.4
What else do I need to do/install? You can ask me if I installed something in the comments.
I had same issue today.
After some curses, I noticed that in gem list there was rubygem-update, but with another path... not in /usr/share/gems/ but in /usr/local/share/gems
So I did
sudo ln -s /usr/local/share/gems/gems/rubygems-update-3.1.4/ /usr/share/gems/gems/rubygems-update-3.1.4
And everything was fine.
I am installing riemann monitoring tool on my PC. I run the following command from terminal:
Command:
sudo gem install riemann-tools
I get the following error:
ERROR: Error installing riemann-tools:
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:1:in `<main>'
A similar error comes when installing riemann-dash but riemann-client get installed successfully.
I am using Ububtu 12.10.
I read online about such errors and it had something with ruby version, but I am not able to figure out the reason for this.
Any help is appreciated.
this solved it for me:
For Debian/Ubuntu
apt-get install ruby-dev zlib1g-dev
For RedHat/CentOS/Fedora:
yum install ruby-devel zlib-devel
This question already has answers here:
Unable to install gem - Failed to build gem native extension - cannot load such file -- mkmf (LoadError)
(17 answers)
Closed 9 years ago.
Hey I'm trying to install rails on a new ubuntu machine. I have ruby and rvm installed but I'm getting a "failed to build gem native extension" error. What does this mean?
$ sudo gem install rails -v 3.2.9
(without the sudo says I don't have permissions)
Then it outputs a lot of 'fetching' commands and ultimately this error:
Building native extensions. This could take a while...
ERROR: Error installing rails:
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:1:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
When I type
$rails server
It says rails is not currently installed
Possible duplicate of:
Unable to install gem - Failed to build gem native extension - cannot load such file -- mkmf (LoadError)
Depending on your ruby version, run:
sudo apt-get install ruby1.9.1-dev
If you are using RVM, you shouldn't ever be using 'sudo'. Using sudo calls libs and such out of the rvm path. Try just a flat:
gem install rails -v3.2.9
and see if that helps.
Tried to install pg gem I got the next error:
alex#ubuntu:~/RubymineProjects/Tiger Skills$ gem install pg
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /var/lib/gems/1.9.1 directory.
alex#ubuntu:~/RubymineProjects/Tiger Skills$ sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
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:2:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/pg-0.15.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/pg-0.15.1/ext/gem_make.out
gem_make.out file:
/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:2:in `<main>'
Already tryed to solve using
$ sudo apt-get install postgresql-client libpq5 libpq-dev
then:
$ sudo gem install pg
That is because you have not set the write permission to the directory,try:
chmod +777 /var/lib/gems/1.9.1
You need to install the -dev part of the Ruby package. Something like:
sudo apt-get install ruby1.9-dev
should give you the parts of Ruby necessary to compile binary extensions.
Good luck!
This help me:
sudo apt-get install rails
I got almost the same problem.
I use this to solve it.
$rvmsudo gem install pg
When I run sudo gem install nokogiri on Ubuntu 12.1, I'm returned with this. What's wrong and how do I fix it?
jason#jason:~/ror/clss$ sudo gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
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:5:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/nokogiri-1.5.5 for
inspection. Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.5.5/ext/nokogiri
/gem_make.out
Try to install the "libxslt-dev" and "libxml2-dev" packages:
sudo apt-get install libxslt-dev libxml2-dev
The instructions are on http://nokogiri.org/tutorials/installing_nokogiri.html
Update:
You need sudo aptitude install ruby1.9.1-dev.
Source: "Rails Tutorial: nokogiri-1.5.2 error on bundle install".