Windows ruby.exe association with .rb

Installing ruby 2.0.0 on windows, I got mismatch
with .rb assocation. Here a little cmd.exe session :

d:\usr\bin>cat vers.rb
puts [RUBY_VERSION,FILE].join(", ")

d:\usr\bin>ruby -v
ruby 2.0.0p0 (2013-02-24) [i386-mingw32]

d:\usr\bin>which ruby

d:\usr\bin>ruby vers.rb
2.0.0, vers.rb

1.9.3, D:/usr/bin/vers.rb


d:\usr\bin>ftype RubyFile
RubyFile=“d:\usr\ruby\Ruby200\bin\ruby.exe” “%1” %*

d:\usr\bin>set | grep -i ruby
Path=C:\Program Files\ConEmu\ConEmu;d:\usr\ruby\Ruby200\bin;…

Does anyone know why direct invoke of “vers.rb” run a older ruby-1.9.3
version ?
(it was managed by pik)

Thank you,

It’s because .rb is associated with that binary. It’s in the registry.
Run explorer, right click on a .rb file, and choose open with. At the
bottom of the context menu will be “choose default program…” use that
to point it at 2.x

As Carey said you simply change the file association in windows. If
you’re using Windows 7, you can find a guide on how to do this here:

I got it : destroy the association and rebuild it :

assoc .rb

assoc .rb=

assoc .rb
Association de fichier introuvable pour l’extension .rb

assoc .rb=RubyFile

ruby vers.rb
2.0.0, vers.rb

2.0.0, D:/usr/bin/vers.rb

thank you