Notes Installing Ruby 2.2.3 on Snow Leopard

  • Update rbenv and rbenv-install via git to recognize 2.2.3
  • First attempt failed because Ruby 2.2 requires clang
  • Installed clang via MacPorts.  Successfully built Ruby 2.2.3 by specifying compiler via CC variable
    $ sudo port select clang clang-3.8
    $ CC=/opt/local/bin/clang rbenv install 2.2.3
  • Set rbenv shell Ruby to 2.2.3 and ran bundle install.
    Failed due to lack of lgomp (OpenMP library) for clang
  • Discovered gcc > v4.4 can be used to install Ruby 2.2
  • Uninstalled MacPorts clang and installed gcc v.49 instead (port name ‘mp-gcc49‘)
  • Ruby 2.2.3 build next failed trying to compile bundled readline
  • Because readline already provided via MacPorts, used RUBY_CONFIGURE_OPTS variable to force use of it
  • After Ruby installed ran bundle install again.
    Build of nokogiri gem now fails with

    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 ***
  • Used --use-system-libraries flag to circumvent and remaining gems installed successfully with bundle install
    $ gem install nokogiri -v1.6.6.2 -- --use-system-libraries