36

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.

AJcodez
  • 509
  • 1
  • 6
  • 9

1 Answers1

61

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.
dezzeus
  • 846
  • 8
  • 9
  • 1
    Not working for me... I have tried that approach several times with php files and XCode keeps trying to open them... – Alex Barker May 12 '17 at 23:11
  • 1
    @AlexBarker seems strange… maybe you have inadvertently done something wrong on your macOS installation. By the way, it's probably related (only) to the "Launch Services" (who spread across several files) and that can be reset-ted / cleaned; the first easy thing that comes to my mind is to install and use "OnyX" to do so (it should have an option; also clean the cache and maybe reboot), otherwise investigate yourself given the keywords (i remember a command `lsregister` but I don't really know how to further help you with it) or try opening a new specific question. – dezzeus May 12 '17 at 23:58
  • 4
    Turns out, the only way to do this is to go into the info section for the file, expand the open with section, and then select a new app and click change all. I guess I thought I would also work from the open with menu. #ThinkDifferent – Alex Barker May 13 '17 at 00:02
  • 4
    @AlexBarker Next time read more carefully both the question and the answer ;) – dezzeus May 13 '17 at 00:15
  • @dezzeus have you fixed it? – Yuri Karpovich Feb 28 '20 at 18:34
  • @YuriKarpovich fixed what ? – dezzeus Feb 29 '20 at 20:17
  • One thing I noticed on 10.14.6 is that it _does_ change the behavior of double click to the new application, but when you right/control click the file in Finder and mouse over "Open with ..." it still claims Xcode is the default. Weird. – Jim K. Sep 15 '20 at 19:22