Saturday, February 5, 2011

"Bad Interpreter: No Medium" error when running Ruby from Git Bash

I'm seeing this error when I run: rake/gem from my Git Bash. Anyone know what it means?

sh.exe": /c/Ruby/bin/gem: D:/Users/Luis/projects/oss/oci/installer2-trunk/ruby/bin/ruby.exe^M: bad interpreter: no medium

Running under Windows/Cygwin - specifically in the Git Bash shell.

  • Thanks to this website: http://www.liquidfish.net/2009/04/ruby-and-git-bash-woes.htm

    Turns out - c:\ruby\bin\gem and c:\ruby\bin\rake both had a weird path in their shebang at the top of the file.

    I removed the full line and replaced it with

    #!ruby.exe
    

    and both work great.

    FYI, this works because I have the path to ruby.exe as part of my system path - if I didn't I'd have to use

    #!(path to ruby.exe)/ruby.exe
    
    David Tchepak : It's also in proxyserver.rb.
    From aronchick

0 comments:

Post a Comment