Ruby-build: Fails to run due to erros on WSL (Ubuntu bash for Windows)

Created on 21 Apr 2017  路  2Comments  路  Source: rbenv/ruby-build

While rbenv works fine, I recently encountered strange error after upgrade (was working before).

$ rbenv install 2.3.4
: invalid optionbenv/plugins/ruby-build/bin/rbenv-install: line 26: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
/home/aurimus/.rbenv/plugins/ruby-build/bin/rbenv-install: line 28: $'\r': command not found
: invalid shell option names/ruby-build/bin/rbenv-install: line 31: shopt: nullglob
/home/aurimus/.rbenv/plugins/ruby-build/bin/rbenv-install: line 32: syntax error near unexpected token `$'do\r''
'home/aurimus/.rbenv/plugins/ruby-build/bin/rbenv-install: line 32: `for plugin_path in "$RBENV_ROOT"/plugins/*/share/ruby-build; do

Anyone has any idea what this is? Pretty sure it's some kind of WSL related issue, maybe related to line endings being different in windows, but can't say why it stopped working after making git pull on ruby-build

Thanks

Most helpful comment

@looks like your rbev-install file has mixed Unix and Windows line endings. Use the dos2unix package to convert all the line endings to Unix.

All 2 comments

@looks like your rbev-install file has mixed Unix and Windows line endings. Use the dos2unix package to convert all the line endings to Unix.

Thanks @benhillis!

Was this page helpful?
0 / 5 - 0 ratings