ZSH version detection broken (use user shell to check for zsh & version) #2029

Closed
eproxus opened this Issue Jul 12, 2013 · 27 comments

Comments

Projects
None yet
5 participants

eproxus commented Jul 12, 2013

The following notice is given when running rvm get head even though the Zsh version is correct (on OS X):

Upgrade Notes:


  * WARNING: In case of using Zsh, version 4.3.12 / 5.0.0+ is recommended, you have 4.3.11, errors to be expected.

  * No new notes to display.

RVM reloaded!

$ which zsh
/usr/local/bin/zsh
$ echo $ZSH_VERSION
5.0.2
Owner

mpapis commented Jul 12, 2013

can you run: which -a zsh

eproxus commented Jul 12, 2013

» which -a zsh
/usr/local/bin/zsh
/bin/zsh
/usr/local/bin/zsh
Owner

mpapis commented Jul 12, 2013

has to be the /bin/zsh version could you confirm?

eproxus commented Jul 12, 2013

Yup:

» /bin/zsh
» echo $ZSH_VERSION
4.3.11
Owner

mpapis commented Jul 12, 2013

please check with rvm get head and rvm notes

eproxus commented Jul 12, 2013

rvm get head now doesn't show any notice anymore. Nice work, thanks!

@eproxus eproxus closed this Jul 12, 2013

s10wen commented Jul 17, 2013

I just did \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable and also got * WARNING: In case of using Zsh, version 4.3.12 / 5.0.0+ is recommended, you have 4.3.11, errors to be expected. I'm setting up a new mac and so far have installed Xcode (and the Command Line Tools) and Homebrew, haven't installed Zsh afaik.

Should I have installed Zsh before rvm?

I have the full log if you'd like it, but not sure what the following are:

?

stty: stdin isn't a terminal

Ignored

/Users/simonowen/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: Unsupported encoding : ignored
/Users/simonowen/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: Unsupported encoding  ignored

Skipping

unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/mail/values/unicode_tables.dat, skipping

Please can you let me know what the above logs mean and if you have any further advice. 🎱

Owner

mpapis commented Jul 17, 2013

@simonowendesign as the first message says In case of using Zsh - so it matters only if you explicitly want to use Zsh - if unsure - means you do not want. as for rest of the messages they look harmless, except stty: stdin isn't a terminal - but for that open a new ticket with full log, not just single line of the output.

s10wen commented Jul 17, 2013

Cool, thanks, new ticket = #2043.

After digging around in Finder I found /usr/lib/zsh/4.3.11 so looks like I'm on the wrong version, although I'm not sure where zsh came from (any ideas?). On my previous machine I threw a bunch of stuff together and got a load of nice stuff up and running: http://simonowendesign.co.uk/blog/2012/12/02/mother-effing-dotfiles/

This time I'm trying to get to grips with it all and find out what I'm actually doing 😄

Owner

mpapis commented Jul 17, 2013

let me rephrase, Zsh and especially OH-MY-ZSH do not bring much, most of the things can be done also in bash, which is more stable and does not break something so often like zsh

s10wen commented Jul 17, 2013

So as I somehow have Zsh should I delete it (if so what's the best way?) and run \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable again?

Owner

mpapis commented Jul 18, 2013

just ignore it

eproxus commented Jul 18, 2013

OS X comes with Zsh preinstalled. I think this warning should only be issued if the user actually uses Zsh.

Owner

mpapis commented Jul 18, 2013

there is no way to detect if user uses Zsh, the warning is displayed from within bash script, you can tell only if Zsh is used while the script is executing in Zsh.

s10wen commented Jul 18, 2013

Cool, thanks for clarifying 🎩

eproxus commented Jul 22, 2013

On OS X you can find out with:

» dscl localhost -read /Local/Default/Users/<USERNAME> shell
dsAttrTypeNative:shell: /usr/local/bin/zsh

On Linux, it should be even easier (check '/etc/passwd').

@mpapis mpapis reopened this Jul 22, 2013

@ghost ghost assigned mpapis Jul 22, 2013

s10wen commented Jul 22, 2013

dscl localhost -read /Local/Default/Users/simonowen shell gave me this if it's any help.

dsAttrTypeNative:shell: /bin/bash

@mpapis mpapis closed this in e034c4e Jul 22, 2013

Owner

mpapis commented Jul 22, 2013

please let me know if there are any issues with the new code

I'm experiencing this issue currently, even after running rvm get head. My circumstances are exactly the same as the OP. Not sure what information is relevant to provide to debug? RVM in general seems to behave oddly on my setup, as if it is not loading my environment.

Owner

mpapis commented Oct 2, 2013

start with giving me:

echo $USER
echo $SHELL
which -a zsh
dscl localhost -read /Local/Default/Users/$USER shell

Wow, speedy response. Fantastic. Here we go:

% echo $USER
jhogendorn
% echo $SHELL
/bin/bash
% which -a zsh
/usr/local/bin/zsh
/bin/zsh
% dscl localhost -read /Local/Default/Users/$USER shell
dsAttrTypeNative:shell: /bin/zsh
Owner

mpapis commented Oct 2, 2013

so the shell you are running is /bin/zsh what version is it?

Ok, so it seem's I answered my own question in a way with that last command, (thanks @mpapis!)

I was not running the shell I believed I was running, for shame etc. I fixed that on OS X by doing this:

brew install zsh
echo "/usr/local/bin/zsh" | sudo tee -a /etc/shells
chsh -s /usr/local/bin/zsh

Thanks for the heads up @mpapis, running rvm get head after this showed no issues.

I seem to having a similar problem with rvm.
After rvm get head and rvm notes,
this is what I got:

Not sure what I did?
It was working fine before and I wanted to make sure my programs come from homebrew installed software
I did this echo export PATH="/usr/local/bin:$PATH" >> ~/.zshrc
I tried deleted what it did, but it's not working

Would updating the shell in /bin/zsh fix it?

Owner

mpapis commented Dec 11, 2013

@anthonybrown this is different error, please open a new issue, also are you aware that ruby 1.9.1 is no more maintained, you should try rather ruby 1.9.3 but as it's losing maintenance with end of this year, so better use ruby 2.0.0, or if it is a new app - 2.1.0 (it's preview2, but will be released in 2 weeks)

Okay, thanks @mpapis
I was just testing to see if rvm still worked after
the #$@* up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment