Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何用 rvm 或 rbenv 來 wide install ruby? #44

Closed
AskBear opened this issue Oct 12, 2015 · 5 comments
Closed

如何用 rvm 或 rbenv 來 wide install ruby? #44

AskBear opened this issue Oct 12, 2015 · 5 comments

Comments

@AskBear
Copy link

AskBear commented Oct 12, 2015

如題~
我想在Ubuntu只安裝一次ruby,就可以給所有使用者使用。
請問該怎麼做?rvmrbenv 都是 for current user 吧?
還是這樣做並不適合?

@zackexplosion
Copy link
Member

之前有想過這問題,不過這東西基本上就是利用 User 把環境隔開,如果特別把他裝 Global 似乎就失去原本故意隔開的意義了。

這裡有一篇文章,你可以參考看看,主要就是把 RBENV_ROOT 給換掉的樣子
http://toschas.com/rbenv-setting-it-up-globally/

@aryung
Copy link

aryung commented Oct 12, 2015

用 root 裝 ruby...
root 裝的 ruby 每個 user 都可以用..
(記的是這樣..path 設好就好了..)..

@AskBear
Copy link
Author

AskBear commented Oct 12, 2015

好像都是不錯的方法,不過我現在在想..
我會有這個問題是,我在架設新的環境時,執行sudo gem install .........
會有sudo: gem: command not found的錯誤
遇到這種情形一般會怎麼解決?

@chinghanho
Copy link
Member

如果是 RVM 的話:

Multi-User installations - For server administrators - For an installation usable by all users on the system - Please note that Single-User supersedes Multi-User. This also used to be called the System-Wide Install. Using this type of installation without knowledge how umask works is a big security risk.

For a Multi-User install you would execute the following:

\curl -sSL https://get.rvm.io | sudo bash -s stable

ref: https://rvm.io/rvm/install#installation-explained

sudo: gem: command not found 問題解法:

rvmsudo

ref: https://rvm.io/integration/sudo

@AskBear
Copy link
Author

AskBear commented Oct 13, 2015

@chinghanho rvmsudo不錯用,謝嚕

@AskBear AskBear closed this as completed Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants