Jamie's Blog

Ruby developer. CTO. Swimmer. Always trying to write more

Installing Rails Plugins with Git on Windows

Ok, so everyone is the rails world seems to have moved over to Git for their version control (which is fine if you’re into the sort of thing). The downside of this is that Windows developers are left without much help when they want to install all those fabulous plugins hosted on GitHub (since most Git users are on Linux and most Rails hackers are on Macs). Well, here’s the trick I just learnt:

Go read this introduction to Git on Windows and install the command-line package of msysgit. Now, if you’ve got Rails 2.1 or later you should be able to do

ruby script\plugin install git://github.com/thoughtbot/shoulda.git

but it will fail with various errors, probably including “Plugin Not Found”. Instead, try:

ruby script\plugin install http://github.com/thoughtbot/shoulda.git/

It’s annoying but it works. Of course, you could just use git to clone the plugin into the directory but then you have to actually install it and I found it just got messy.

Update: I noticed that with a new Rails project I didn’t have this issue and the first method works fine.  I’d upgraded the old pre-2.1 project but obviously something didn’t stick.  So another method might be to recreate the project.