$ gem install rails
ERROR: Could not find a valid gem 'rails'(>= 0), here is why:
Unable to download data from https://rubygems.org/
- SSL_connect returned=1errno=0state=SSLv3 read server certificate B:
certificate verify failed (https://api.rubygems.org/latest_specs.4.8.gz)
$ export SSL_CERT_FILE=$HOME/local/rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/AddTrustExternalCARoot-2048.pem
$ gem install rails
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/home/user/local/rbenv/versions/2.1.5/bin/ruby extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for gzdopen() in -lz... yes
checking for iconv... no
-----
libiconv is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/user/local/rbenv/versions/2.1.5/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
extconf failed, exit code 1
Gem files will remain installed in /home/user/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.8.rc2 for inspection.