Skip to content

Instantly share code, notes, and snippets.

@aspyatkin
Last active March 5, 2019 01:02
Show Gist options
  • Save aspyatkin/d2b28fc754e009bd4a48 to your computer and use it in GitHub Desktop.
Save aspyatkin/d2b28fc754e009bd4a48 to your computer and use it in GitHub Desktop.
Ruby 2.3.0 on Cygwin x64

Installing Ruby 2.3.0 on Cygwin x64

Warning!

You won't get a fully-functional installation! At the time of writing, it turned out gem is kind of broken on Ruby 2.3.0. Ruby gem installation fails with an error like kernel_require.rb:54:in require': cannot load such file -- win32/resolv`.

Prerequisites

Installation

Install essential packages

The following packages should be installed with apt-cyg:

  • git
  • gcc-core
  • gcc-g++
  • make
  • zlib-devel
  • curl
  • autoconf
  • libiconv
  • libiconv-devel
  • rsync
  • patch
  • unzip
  • openssh
  • openssl-devel
  • libxml2-devel
  • libxslt-devel
  • libffi-devel
  • libgdbm-devel
  • libreadline-devel

Install rbenv

Install rbenv and ruby-build as usual.

Build Ruby 2.3.0

$ rbenv install 2.3.0
$ rbenv global 2.3.0
$ rbenv rehash

To check, run ruby -v. You will get something like that:

ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-cygwin]
@ramizudd
Copy link

Had to do following to make it work:

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
$ echo 'source $HOME/.zshenv' >> ~/.zshrc
$ exec $SHELL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment