Thursday, June 19, 2014

Cygwin tricks with Ruby

First thing, install the Cygwin version of Ruby:



during Cygwin setup, otherwise if you try to run the Windows version of Ruby you will get:

C:\Ruby200-x64\bin\ruby.exe: No such file or directory -- /cygdrive/c/Ruby200-x64/bin/r10k (LoadError)

This is BAD:
$ ruby --version
ruby 2.0.0p353 (2013-11-22) [x64-mingw32]

This is GOOD:
$ ruby --version
ruby 1.9.3p545 (2014-02-24) [x86_64-cygwin]

And, to be on the safe side, remove the Windows Ruby from the PATH.

If when you try to install r10k

gem install r10k

you get this error:


/usr/lib/ruby/1.9.1/net/http.rb:763: [BUG] rb_sys_fail(connect(2)) - errno == 0

...
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Aborted (core dumped)



then try first to configure the proxy inside Cygwin:

export http_proxy=http://yourusername:yourpassword@proxy.acme.com:8080


No comments: