RVM安装:is_a_function:命令未找到。

4

安装了rvm之后,使用以下命令:

$ curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer > rvm-installer
$ bash rvm-installer 

我按照rvm网站的建议进行了以下操作:

$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
$ source .bash_profile 
-sh: is_a_function: command not found

当我查看安装输出时,我发现在安装过程中也报告了这个错误(虽然我也看到:“将 RVM 安装到 /Users//.rvm/ 完成。”)。
我查看了 rvm 脚本,能够看到 utility 脚本中的 is_a_function 函数。
请指导我现在需要做什么来修复这个问题。
附注:由于我一直收到以下错误消息,所以不得不将安装程序下载到本地:
$ bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
-sh: syntax error near unexpected token `<'

那句"Installation of RVM to /Users//.rvm/ is complete."看起来有点不对。RVM实际上安装到了哪里?你应该将[[ -s "$HOME/.rvm/scripts/rvm"...内容添加到你的.bashrc文件中(这样每次启动BASH时都会自动调用它,而不需要从命令行显式调用它)。 - Michael Dautermann
嗨,Michael,感谢回复。实际上它的输出是:/Users/[my_user_name]/.rvm/ 不知道为什么会被删除。我按照rvm笔记中提到的添加了行到.bash.profile(请参见命令行的右端)。我不认为问题在于命令的目标位置,而是关于函数is_a_function()的可用性。 - Karthick S
1个回答

7

我曾遇到同样的错误,但切换到稳定版本后,似乎问题得到了解决。

已起效:

sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

$ sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
  • sh: 在 '<' 附近有语法错误的标记
- Karthick S
稍作修改就解决了。但根本原因似乎是“-s stable”: $ curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable - Karthick S
这是如何工作的?我真的看不出在那里添加“stable”会改变curl下载的内容。 - Paul Biggar
稳定版本给了我这个错误:“-bash:sudo:命令未找到” - Matt Andrzejczuk

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接