I’ve spent the last couple days trying to get Ruby 2.3 to build on Windows using Visual Stuido. It’s been… Interesting to say the least.
At Spiceworks, we actually have patches of our own to apply to the Ruby source to handle some special cases around Win32 OLE (I believe one of them is actually a bug in Ruby but I haven’t been able to find anything on it). It’s been fun finding where things have changed from 2.1 to 2.3. Thankfully most things have translated fairly nicely and I’ve got Ruby compiling at this point but still struggling with trying to get it wedged into our “build” system.
The current troubles I’ve had revolve around getting rake to install to right place. Currently when running the install script I get the following problem:
What appears to be happening is when the tool/rbinstall.rb script runs it calls the install method on each gem included in the build. That gets into RubyGems installer.rb which eventually gets to the generate_bin method. From what I can tell, this method simply makes sure that the the destination bin_dir (where the gems binary executables will copied/symlinked to) and bin_path (where the gems binary executables will be installed) has the proper permissions to be written to and exist.
Now the issues seems to be the that the /bin directory for rake doesn’t exist, and therefore the installation process stops. What’s weird is that if I modify that file to add the directory manually, it seems to die because directly after the script adds it, the whole thing gets wiped out from somewhere.
Not sure, where or why that’s happening but my approach is going to be two fold:
First, find out why the /bin wasn’t written properly in the first place. I wonder if it’s a permissions issue with directory, or if the gem isn’t able to write things and is just swallowing up the error message. This probably means diving into the gem itself but it might mean further spelunking in RubyGems
Second, see if I can determine why when I add the the /bin folder manually it gets wiped out. Ideally, the first step solves the second, but I’m confused as to why the directory is getting wiped.
In either case, I’m trying to avoid modifying the Ruby source any further.