1

I am trying to run a simple ruby script on windows using mingw32

I am having some path issues I think because the simple script below uses the windows mkdir instead of the mkdir that ships with mingw32. I know this because it creates two files "-p" and "hello" which is what the windows mkdir does. It is supposed to just create the hello direcory. -p is a switch. The mkdir command works fine on the ming32 prompt. How do I make ruby use the right mkdir?

mkdir.rb:

`mkdir -p hello`

user1159819
  • 1,549
  • 4
  • 16
  • 29
  • possible duplicate of [Does Ruby have mkdir -p?](http://stackoverflow.com/questions/11463343/does-ruby-have-mkdir-p) – Max Oct 30 '14 at 17:08
  • 1
    not really, I am asking how to invoke mingw32's mkdir from ruby – user1159819 Oct 30 '14 at 17:13
  • Do you **need** to call `mkdir` using backticks? Why can't you use the `mkdir_p` provided by Ruby? That should do the appropriate thing for your platform. – Max Oct 30 '14 at 18:45
  • that would probably be better but I inherited this script. Switched to cygwin and script works perfectly – user1159819 Nov 03 '14 at 19:25

0 Answers0