rvm mount

一直不知道rvm有一個(gè)mount功能,這次使用rvm自動安裝jruby一直不成功,結(jié)果通過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中,方便統(tǒng)一的管理。

rvm automount可以自動加載在PATH環(huán)境變量中能識別的Ruby。

比如經(jīng)常因?yàn)楸粔Φ脑颍瑹o法下載ruby的源碼進(jìn)行本地編譯,rvm安裝ree經(jīng)常失敗,還有我這次遇到的安裝jruby總是編譯失敗,那么解決的方法就很簡單,在jruby的官網(wǎng)下載已編譯好的版本,解壓到本地,/opt/jruby/,然后再rvm mount /opt/jruby即可!

rvm會自動識別版本,然后創(chuàng)建一個(gè)ext-開頭的Ruby版本,隨時(shí)可以通過rvm use ext-jruby-xxx來使用了。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容