From: Luis Lavena Date: 2011-12-13T08:47:56+09:00 Subject: Re: Ruby 1.9.3-p0 + Cygwin 1.7.9-1 + posix-spawn-0.3.6: Can't set RUBY_PLATFORM = cygwin Daniel Black wrote in post #1036381: > Hi there, > > I've been trying to get jekyll installed within the Cygwin 1.7.9-1 > environment using Ruby 1.9.3-p0 on WinXP. Ruby and RubyGems are working > fine. However, I continually run into an issue with posix-spawn being > unable to compile when trying to install Jekyll. > > The posix-spawn developers created a patch to keep posix-spawn from > compiling, as it's unnecessary. However, there are a couple of issues > I'm having: > > - I can't get this gem (posix-spawn-0.3.6.gem) with the patch > applied. Installing with 'gem install posix-spawn' after removing from > cache and gems doesn't pull the fresh code; and Go here: http://rubygems.org/gems/posix-spawn Click download, place posix-spawn-0.3.6.gem somewhere accessible by cygwin. Then: gem install --local /path/to/posix-spawn-0.3.6.gem That will install the local copy. > - The patch assumes RUBY_PLATFORM ~= "cygwin" (among others). > However, ruby 1.9.3-p0 sets RUBY_PLATFORM to "i386-cygwin" so the > comparison won't work. > Where you see that? This commit: https://github.com/rtomayko/posix-spawn/commit/146a3e665924e76aa45cd2c725dd5a978a74cc8e Introduces: RUBY_PLATFORM =~ /(mswin|mingw|cygwin|bccwin)/ Which is a valid regular expression and will be true if RUBY_PLATFORM == "i386-cygwin": >> platform = "i386-cygwin" => "i386-cygwin" >> platform =~ /(mswin|mingw|cygwin|bccwin)/ => 5 >> > I'm new to Ruby, and am admittedly only using it for Jekyll (at the > moment). I realize that some of the issue likely resides within Cygwin, > but seems I should be able to address each issue within Ruby itself. Can > I just set RUBY_PLATFORM in the Makefile and rebuild? How can I get the > updated posix-spawn code? Hand-editing the two changed .rb files in > posix-spawn to add the comparison doesn't help, as each time I run "gem > install *" posix-spawn is installed over any changes I've made. > 1) You can build the gem your self 1.1) Clone posix-spawn repository, 1.2) introduce the modifications 1.3) generate the gem with "rake gem" 2) report the issue to the gem authors: https://github.com/rtomayko/posix-spawn/issues 3) You can't force RUBY_PLATFORM, that is actually not the problem you're experiencing. -- Luis Lavena -- Posted via http://www.ruby-forum.com/.