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

I opened my Windows VM last night for the first time in months to finally work on a .NET project from Github.  When I found out I needed the rspec gem installed (I’m normally a shoulda guy), I decided to see what gems I had installed first:

gem list

and got the following error:

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

Umm….. D:/Users/Luis? After some googling I found this article on StackOverflow that directed me to this blog.  It pretty much states that the shebang line (#!) at the top of my Ruby One-Click installer file had changed/been corrupted, I don’t know.  I changed the line to point to my ruby exe (#!C:Rubybinruby.exe) and my gem commands started working again.

About Jason Meridth

Continuously learning software developer trying to not let best be the enemy of better
This entry was posted in bash, gems, windows. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

2 Responses to “Bad Interpreter: No Medium” error when running Ruby from Git Bash

  1. dude, i can’t tell you how many times this error has frustrated the crap out of me! thanks for the post and providing a link to the solution.


  2. @Derick

    Glad it helped. I was baffled that some random guys path was on my system. :)