Rbenv: WSL + ZSH/bash, errors on init

Created on 23 Oct 2017  路  2Comments  路  Source: rbenv/rbenv

I want to install rbenv on Ubuntu on Windows (Windows Subsystem for Linux) and cloned the git repository to the subsystem users home folder. When running the init script however (in zsh + oh-my-zsh), I get the following error:

/home/main/.rbenv/bin/rbenv: line 2: set: -
: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
/home/main/.rbenv/bin/rbenv: line 3: unset: `CDPATH
': not a valid identifier
/home/main/.rbenv/bin/rbenv: line 4: $'\r': command not found
/home/main/.rbenv/bin/rbenv: line 15: syntax error near unexpected token `$'{\r''
/home/main/.rbenv/bin/rbenv: line 15: `abort() {
'

I'm not sure who's to blame here, zsh or rbenv.

EDIT1: Also doesn't work with bash.

Most helpful comment

To fix this I ran dos2unix over the whole rbenv folder:

find ~/.rbenv -type f -exec dos2unix {} \;

Hope that helps anyone else that finds this

All 2 comments

This problem was caused because of (wierdly) git assuming that the OS is windows and converted the files to CRLF on checkout.

To fix this I ran dos2unix over the whole rbenv folder:

find ~/.rbenv -type f -exec dos2unix {} \;

Hope that helps anyone else that finds this

Was this page helpful?
0 / 5 - 0 ratings