Reputation: 23893
I got this error message when trying to install rails on Centos 7.
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
Gem files will remain installed in /usr/local/share/gems/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /usr/local/share/gems/gems/nokogiri-1.6.6.2/ext/nokogiri/gem_make.out
Command
gem install rails -v 4.2.3 --no-rdoc --no-ri
Upvotes: 0
Views: 772
Reputation: 73
Nokogiri is causing you problems. Installing all the build dependencies and try again.
sudo yum install -y gcc ruby-devel zlib-devel libxml2 libxml2-devel libxslt libxslt-devel make
If it still fails, try to build it with the --use-system-libraries
build option.
gem install nokogiri -- --use-system-libraries
If all else fails, install it from the EPEL repository.
sudo yum install -y epel-release
sudo yum install -y rubygem-nokogiri
Upvotes: 2