3

After upgrading to Yosemite my ruby dev environment was not working well so I thought I would take the opportunity to switch to chruby from rbenv.

It's all gone pretty well after installing and I can switch between rubies easily, but I cannot set a default Ruby.

If I add the line chruby ruby-2.1.3 to my ~/.zprofile file then open a new terminal window I get the following error message;

/Users/brad/.zprofile:1: command not found: chruby

I have added source /usr/local/share/chruby/chruby.sh to my ~/.zshrc file as described in the configuration section for chruby. I'm not sure what else to do to get this working - I'm no expert at finding my way around shell config settings. Any clever ideas?

brad
  • 9,573
  • 12
  • 62
  • 89
  • 1
    `.zprofile` is sourced before `.zshrc` – Stefan Nov 17 '14 at 14:19
  • OK, so why is the recommended way to set a default Ruby the way I have done it then? It feels like I've missed a step, but I don't know what. – brad Nov 18 '14 at 01:05
  • Recommended where and by whom? It may just be, that the author of the recommendation never really tested it with `zsh`. – Adaephon Nov 18 '14 at 07:28
  • In the chruby readme by the chruby author. – brad Nov 18 '14 at 07:59
  • Maybe the documentation is incorrect or assumes a specific setup. Have you tried to source `chruby.rb` from within `.zprofile` before calling `chruby`? – Stefan Nov 19 '14 at 15:50

0 Answers0