rvm mount

作者: waynedeng | 来源:发表于2016-03-23 21:42 被阅读222次

一直不知道rvm有一个mount功能,这次使用rvm自动安装jruby一直不成功,结果通过mount搞定,和大家分享一下。

首先看看rvm help mount说了些什么:

# rvm help mount
Usage:

    rvm automount
    rvm mount /path/to/ruby [-n {name}]
    rvm mount [-r] {https://url/to/ruby.tar.bz2} [name]


## Mounting local compiled rubies

RVM supports adding rubies compiled by user.

If compiled ruby is already on `PATH` then use:

    rvm automount

If ruby is not on `PATH` and was compiled in `/opt/ruby-1.9.3-p194`,
then both following commands will add it to RVM:

    rvm mount /opt/ruby-1.9.3-p194
    rvm mount /opt/ruby-1.9.3-p194/bin/ruby

RVM will ask user for the name for it, for automation you can use `-n` flag:

    rvm mount /opt/ruby-1.9.3-p194 -n ruby-1.9.3-p194

Which will create `ext-ruby-1.9.3-p194`, the `ext-` prefix is there to
distinguish externally compiled rubies.

rvm mount的功能是加载安装本地已有编译好的Ruby版本到rvm中,方便统一的管理。

rvm automount可以自动加载在PATH环境变量中能识别的Ruby。

比如经常因为被墙的原因,无法下载ruby的源码进行本地编译,rvm安装ree经常失败,还有我这次遇到的安装jruby总是编译失败,那么解决的方法就很简单,在jruby的官网下载已编译好的版本,解压到本地,/opt/jruby/,然后再rvm mount /opt/jruby即可!

rvm会自动识别版本,然后创建一个ext-开头的Ruby版本,随时可以通过rvm use ext-jruby-xxx来使用了。

相关文章

  • rvm mount

    一直不知道rvm有一个mount功能,这次使用rvm自动安装jruby一直不成功,结果通过mount搞定,和大家分...

  • rvm安装与一些命令

    rvm官方网站 https://rvm.io 安装命令 rvm升级 参考网站:https://rvm.io/rvm...

  • 在Kali Linux中利用rvm安装ruby

    本文参考http://rvm.io/rvm/security 和 http://rvm.io/rvm/instal...

  • 终端安装rvm

    查看当前rvm版本 如果未安装rvm,则显示 -bash: rvm: command not found安装rvm...

  • xcodebuild使用OptionsPlist参数导出Adho

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/s...

  • mac离线安装rvm

    上github下载rvm,https://github.com/rvm/rvm.git。 双击打开/bin/rvm...

  • Mac上离线安装rvm

    上github下载rvm,https://github.com/rvm/rvm.git。 双击打开/bin/rvm...

  • mount命令

    mount [-hV] mount -a [-fFnrsvw] [-t vfstype] mount [-fnrs...

  • Linux mount

    理解Mount 挂载 (mount) 深入理解 bind mount 将目录挂载到目录 mount --bind ...

  • ruby 升级

    安装rvm curl -sSL https://raw.githubusercontent.com/rvm/rvm...

网友评论

      本文标题:rvm mount

      本文链接:https://www.haomeiwen.com/subject/orgqlttx.html