【问题标题】:Can't install RVM on Mac OS X Lion无法在 Mac OS X Lion 上安装 RVM
【发布时间】:2011-09-15 06:20:01
【问题描述】:

我使用的是 Mac OS X Lion,但无法安装 RVM。我在 RVM 网站上关注了installation guide 并尝试了 zshbash 并在第一步中遇到了同样的问题:

$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
Successfully checked out branch ''
Current branch master is up to date.
Successfully pulled (rebased) from origin 
bash: ./scripts/install: /bin/bash^M: bad interpreter: No such file or directory

但是,如果我进入目录/bin,程序bash 就在那里。

有人知道这里发生了什么吗?

【问题讨论】:

    标签: ruby bash shell installation rvm


    【解决方案1】:

    你必须配置 git。

    git config --global core.autocrlf input
    git config --global core.safecrlf true
    

    然后rm -rf ~/.rvm 并尝试再次安装rvm。

    【讨论】:

    • git 中的问题。 Git 以 windows 文件格式从服务器拉取更改(默认情况下)。
    • 我明白了。起初我不明白你的答案,因为我没有看到我的问题与 git 有什么关系。谢谢。
    【解决方案2】:

    这种情况下的问题是,shebang 的末尾有一个CR+LF newline。因为您运行的是 Unix 系统,所以只有 LF 被解释为换行符,并且 CR 符号被添加到解释器中,这导致 bash 搜索名称为 /bin/bash&lt;CR&gt; 的文件,其中 &lt;CR&gt; 是单个回车符符号。

    avy 建议的修复应该可以解决问题。

    【讨论】:

    • 感谢您的解释:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-14
    • 1970-01-01
    • 1970-01-01
    • 2012-01-22
    • 2012-12-30
    • 2011-11-16
    相关资源
    最近更新 更多