【问题标题】:rvm installation: is_a_function: command not foundrvm 安装:is_a_function:找不到命令
【发布时间】:2011-12-24 11:08:55
【问题描述】:

安装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 脚本,并且能够在实用程序脚本中看到函数 is_a_function。

请告知我现在需要做什么来解决这个问题。

P.S.:我不得不在本地下载安装程序,因为我不断收到以下错误:

$ 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 时都会调用它,而不必从命令行显式调用它)。
  • 嗨迈克尔,感谢您的回复。它实际上给出了输出:/Users/[my_user_name]/.rvm/ 不知道为什么会被删除。如 rvm 注释中所述,我将这些行添加到 .bash.profile 中。 (见命令行的右端)我认为问题不在于命令的目的地。这是关于函数 is_a_function() 的可用性。

标签: ruby macos osx-lion rvm


【解决方案1】:

我遇到了同样的错误,但切换到稳定版本似乎已经解决了它。

确实有效:

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

【讨论】:

  • $ sudo bash -s stable raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) -sh: 意外标记 ` 附近的语法错误
  • 稍作改动就解决了。但根本原因似乎是“-s stable”:$ curl -s raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s 稳定
  • 这是如何工作的?我真的不明白在那里添加“稳定”会改变什么 curl 下载?
  • 稳定版给了我这个错误:“-bash: sudo: command not found”
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-22
  • 2011-07-21
  • 2012-07-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-11-04
相关资源
最近更新 更多