I am trying to install rails on an amazon-linux instance, but I keep getting the same error reported in this question:
[ec2-user@xxx.xxx ~]$ sudo gem install rails --no-ri --no-rdoc
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/ruby/gems/2.3/gems/nokogiri-1.7.2/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20170529-26560-9zyb13.rb extconf.rb
Note that I manually upgraded ruby to 2.3
[ec2-user@xxx.xxx ~]$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux-gnu]
I've also tried with another versions of rails (I'd like to install the latest, 5.1.1), with also no luck
sudo gem install rails --version 5.1.1 --no-ri --no-rdoc
sudo gem install rails --version 5.0.0 --no-ri --no-rdoc
sudo gem install rails --version 4.2.8 --no-ri --no-rdoc
Is this possible at all or do I need to downgrade ruby to 2.0?