Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Annotate doesn't work on windows #49

Kulgar opened this Issue Sep 15, 2011 · 5 comments


None yet
5 participants

Kulgar commented Sep 15, 2011

Hi everyone :)

Annotate has a strange behavior on Windows. I managed to install it, I added it to my gemfile, did the bundle install and so... I can launch the command "annotate" but then... nothing happens.

No matter how long I wait nothing come out.

I'm using Rails 3.0.9, mysql2 version 0.2.7 and the very last version of annotate (2.4.0).
Does anyone one have the same issue and came with a solution ?

Thanks to all the good soul who'll try to help me :)


Dagnan commented Sep 15, 2011

Lots of gems do not work on Windows. This is not a troll, but if you're thinking seriously about developping in Rails (et d'après ton blog j'imagine que oui :), you should consider using Linux (even through a virtual machine, which takes 10 min to setup) or... Mac OS.

Kulgar commented Sep 15, 2011

Yeah I know... I'm quite stuborn with my windows environment for development :)

So far I had no problems programming Rails applications on Windows ^^. You're probably right, I should develop on another system and I'll surely do it. But I was hoping that someone did find a little trick to have annotate works on windows, I did find something, a little piece of code to add in lib/tasks, but it no longer works because of some new deprecated methods.

Well thanks for the answer by the way :) but if anyone have a trick, I'll be glad to learn it ^^.


PS : I just wanted to tell people that "yes it is possible to develop on a Windows System", but yeah... as it is not a most recommanded environment for development, a lot of things just don't work right on Windows and that's not a troll, it's a fact, believe me ^^.

PPS (to answer to the French part of the message) : yes, my firm creates Rails Web Site, we love that language/framework and we started a French blog because the French community doesn't have a lot of rails lovers and rails information (don't know why, maybe because all the French Rails lovers know English xD and PHP ones does not :P).

The little trick I found was to create a "annotations.rake" file inside the /lib/tasks directory of the Rails project and put this code inside the file: (but it worked with annotate_models, which is no longer maintained)

 require 'annotate_models'

   def annotate_models
              :position_in_class => 'before', 
              :position_in_fixture => 'before'

   namespace :db do
        task :migrate do

   namespace :migrate do
       [:up, :down, :reset, :redo].each do |t|
          task t do

turadg commented Sep 15, 2011

@Kulgar, have you tried bundle exec annotate ?

Kulgar commented Sep 15, 2011

Yes I did and I had a strange error :

c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:143:in block in replace_gem': an from c:/Ruby192/lib/ruby/gems/1.9.1/bin/annotate:18:in


One of the first I quite don't understand...

Old thread, but ... got it to work with win7 x64
adding to Gemfile
"gem 'annotate'"
would not work, but
"gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'" did
However, heroku (maybe Item #36) did not like that so I removed the gem

@ctran ctran closed this Aug 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment