I’m not going to start a pissing match who is the greater dev, based on operating system. People mocked me with “_real_ devs don’t use windows”. Sometimes maintainers aren’t even open to another CI which would prevent breaking changes in the future.Īfter writing that blog post, people attacked me with nonsense like “well then fix it” – as if I hadn’t tried. Sometimes, though, bugs remain open for years (not exxagerrating!). And sometimes it only took raising an issue with the author, sometimes it took a tiny contribution. But every once in a while something wouldn’t work. That might have been my blog post (shameless self-plug: )Īvdi is right: Ruby itself is not the problem here. But you can’t tell it to “fork” the current process into two identical processes.
#Ruby download windows windows
You can use the Windows API to spawn a new process executing a given executable. Windows, by contrast, uses what Ritchie refers to above as “the most common model”. Still, it seems reasonable to suppose that it exists in Unix mainly because of the ease with which fork could be implemented without changing much else. The separation of the functions is certainly not unique to Unix, and in fact it was present in the Berkeley time-sharing system, which was well-known to Thompson. The most common model for the creation of new processes involves specifying a program for the process to execute in Unix, a forked process continues to run the same program as its parent until it performs an explicit exec. A good example is the separation of the fork and exec functions.
…it is easy to see how some of the slightly unusual features of the design are present precisely because they represented small, easily-coded changes to what existed. Now, I know some people might take offense at my calling fork() “peculiar”. As such, it exposes some subprocess features which are peculiar to UNIX-like systems. Ruby’s Process API is built on the POSIX set of UNIX system calls.
#Ruby download windows code
That meant that when C code was running on a UNIX host, the process of translating internal to external linefeeds would be a matter of replacing LF… with LF. They picked this one because C was developed on UNIX, and the UNIX native newline character was LF. And they settled on the Line Feed (LF) code. Of course, this meant that they had to choose an ASCII code that they would use for this standard internal newline representation. And that whenever text was read into, or written out of, a C program, those internal newlines would be translated from and to whatever the platform native newline convention happened to be, whether CR+LF, LF+CR, CR, or something else.
#Ruby download windows portable
They knew they wanted to build a language where it was possible to write portable code that would work on any of those operating systems.Īnd so, they decided that C would have an standard, internal, logical representation of newlines. The creators of C knew that all of these different text line ending conventions existed out there in the world of operating systems. Ruby is built on the C programming language, and like most modern languages its system calls and conventions are in a large part based on those of C. It probably isn’t accurate for code running under the new Ubuntu-on-Windows layer. Note also that everything below applies to windows builds of Ruby.
But in my experience the issues I list here make up at least 80% of the Windows compatibility problems I encounter. And it probably contains some inaccuracies. Note that this guide is far from complete.
(I’m also writing this in answer to some of the questions Josh asked when reviewing the pull request.) So I thought that with this experience is still fresh in my mind, I’d use it to write a little intro to making your Ruby code Windows-compatible. The changes I ended up making turned out to hit upon most of the high points (and a few of the more obscure ones) of writing Ruby code that’s portable to Windows. This turned out to be a sizable but highly instructive project that took me the better part of 2 days Lately I’ve been sorely missing having it available when I’m writing code on my Windows box, so I decided to make it work on Windows. One of my most indispensable Ruby tools is the seeing_is_believing gem by Josh Cheek.