In Terminal, ruby -v gives me:
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]
But if I type /bin/bash then ruby -v I get:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
I suspect this is something to do with my PATH config(s). My $PATH variable is different in both the above environments. There are other issues e.g. rvm won’t run unless I go into bash mode.
For info, my ~/.bashrc contains:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
This was not due to a $PATH problem. What I’ve learned is that RVM cannot be run unless you change your default login shell to either Bash or ZSH. Just firing up Terminal in Mac won’t work. You make the global change to using Bash like this:
(swap
/bin/bashfor whatever your bash path is, find out usingwhich bash).The RVM website does say that bash>=3.2.25 is a prerequisite, but doesn’t say what that is or how to check whether you have it. It also advises you to run
rvm requirementsto check what you need – and you can’t run this unless you change your shell (all quite confusing for somebody new to this).Thanks to the replies above for getting me there in the end.
See also: Bad: modifier error when installing RVM