osx - stop xcode from opening ruby files

I have set my favorite text editor as the default application to open ruby files (.rb extension) multiple times by following Open With -> then Other... then I click the checkbox Always Open With.

However, every time I restart my computer, it gets set back to xcode. How can I prevent xcode from ever opening a .rb file?

I'd uninstall xcode completely, but I need the command line tools for compiling software.


You should do the following:

  1. Select a Ruby file.
  2. Get info (right click or [CMD] + [I]).
  3. Select your text editor under the Open with panel.
  4. Click Change all.