如何在没有root用户访问权限的情况下安装rvm? [英] How do I install rvm without root access?

查看:106
本文介绍了如何在没有root用户访问权限的情况下安装rvm?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将travis gem安装在没有ruby gem且没有root权限的机器上. (我想加密一些内容以供travis使用.)我决定尝试安装rvm,因为 https://rvm. io/rvm/install 表示,这是一种无需root用户即可安装ruby的简便方法.但是,我马上遇到了问题:

I would like to install the travis gem on a machine without ruby gems, and on which I don't have root. (I want to encrypt something for use with travis.) I decided to try to install rvm, because https://rvm.io/rvm/install suggests that it is an easy way to install ruby without root. However, I ran into problems right away:

jgross@cagnode17:~$ \curl -L https://get.rvm.io | bash -s stable --ruby
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13961  100 13961    0     0  15390      0 --:--:-- --:--:-- --:--:--  170k
Please read and follow further instructions.
Press ENTER to continue.
Downloading RVM from wayneeseguin branch stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1083k  100 1083k    0     0   200k      0  0:00:05  0:00:05 --:--:--  199k

Installing RVM to /afs/csail.mit.edu/u/j/jgross/.rvm/
    RVM PATH line found in /afs/csail.mit.edu/u/j/jgross/.bashrc /afs/csail.mit.edu/u/j/jgross/.zshrc.
    RVM sourcing line found in /afs/csail.mit.edu/u/j/jgross/.bash_profile /afs/csail.mit.edu/u/j/jgross/.zprofile.
Installation of RVM in /afs/csail.mit.edu/u/j/jgross/.rvm/ is almost complete:

  * To start using RVM you need to run `source /afs/csail.mit.edu/u/j/jgross/.rvm/scripts/rvm`
    in all your open shell windows, in rare cases you need to reopen all shell windows.

# Jason Gross,
#
#   Thank you for using RVM!
#   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne

# In case of problems:
#      run and read: rvm notes
#         read docs: http://rvm.io/
#        talk to us: http://webchat.freenode.net/?channels=rvm (http://freenode.net/faq.shtml#plusr)
#   read cheatsheet: http://cheat.errtheblog.com/s/rvm
#  watch screencast: http://screencasts.org/episodes/how-to-use-rvm
# open a bug report: https://github.com/wayneeseguin/rvm/issues

rvm 1.22.2 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

Searching for binary rubies, this might take some time.
Checking requirements for debian.
Installing requirements for debian.
jgross password required for 'apt-get --quiet --yes update': 
Sorry, try again.
jgross password required for 'apt-get --quiet --yes update': 
Sorry, try again.
jgross password required for 'apt-get --quiet --yes update': 
Sorry, try again.
sudo: 3 incorrect password attempts
Requirements installation failed with status: 1.

所以我再次尝试:

jgross@cagnode17:~$ \curl -L https://get.rvm.io | bash -s stable --ruby
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13961  100 13961    0     0  27936      0 --:--:-- --:--:-- --:--:-- 27936
Please read and follow further instructions.
Press ENTER to continue.
Downloading RVM from wayneeseguin branch stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1083k  100 1083k    0     0   158k      0  0:00:06  0:00:06 --:--:--  186k

Upgrading the RVM installation in /afs/csail.mit.edu/u/j/jgross/.rvm/
    RVM PATH line found in /afs/csail.mit.edu/u/j/jgross/.bashrc /afs/csail.mit.edu/u/j/jgross/.zshrc.
    RVM sourcing line found in /afs/csail.mit.edu/u/j/jgross/.bash_profile /afs/csail.mit.edu/u/j/jgross/.zprofile.
Upgrade of RVM in /afs/csail.mit.edu/u/j/jgross/.rvm/ is complete.

# Jason Gross,
#
#   Thank you for using RVM!
#   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne

# In case of problems:
#      run and read: rvm notes
#         read docs: http://rvm.io/
#        talk to us: http://webchat.freenode.net/?channels=rvm (http://freenode.net/faq.shtml#plusr)
#   read cheatsheet: http://cheat.errtheblog.com/s/rvm
#  watch screencast: http://screencasts.org/episodes/how-to-use-rvm
# open a bug report: https://github.com/wayneeseguin/rvm/issues

Upgrade Notes:

  * No new notes to display.


rvm 1.22.2 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

Searching for binary rubies, this might take some time.
Checking requirements for debian.
Installing requirements for debian.
jgross password required for 'apt-get --quiet --yes update': 
Sorry, try again.
jgross password required for 'apt-get --quiet --yes update': 
sudo: 1 incorrect password attempt
Requirements installation failed with status: 1.
ruby-2.0.0-p247 is not installed.
Creating alias default for ruby-2.0.0-p247.
Recording alias default for ruby-2.0.0-p247.
Creating default links/files
ruby-2.0.0-p247 is not installed.
Could not load ruby ruby-2.0.0-p247.
/afs/csail.mit.edu/u/j/jgross/.rvm/scripts/alias: line 108: /afs/csail.mit.edu/u/j/jgross/.rvm/rubies/ruby-2.0.0-p247/bin/ruby: No such file or directory

  * To start using RVM you need to run `source /afs/csail.mit.edu/u/j/jgross/.rvm/scripts/rvm`
    in all your open shell windows, in rare cases you need to reopen all shell windows.

尝试rvm install 1.8给我同样的关于debian要求的错误消息.除了放弃rvm和从源头构建红宝石之外,我还有其他选择吗?

Trying rvm install 1.8 gives me the same error message about debian requirements. Do I have any option other than giving up rvm and building ruby from source?

推荐答案

TL; DR

您缺少构建Ruby所需的软件包依赖关系.

TL;DR

You're missing package dependencies needed to build Ruby.

您面临的问题是RVM的最新(ish)版本使用了称为 autolibs 的功能,安装软件包依赖项.当然,您需要 sudo 访问权限才能安装系统软件包.您可以尝试使用以下命令安装Ruby解释器:

The issue your facing is that recent(ish) versions of RVM use a feature called autolibs that attempt to install package dependencies. Of course, you need sudo access to install system packages. You could try installing a Ruby interpreter with:

  • --autolibs=read-only-避免 sudo 错误,但这不太可能导致二进制文件正常工作.
  • --autolibs=rvm_pkg-如果RVM可以提供丢失的依赖项,则将使用旧的rvm pkg install ...来安装它们,这将花费很长时间,并且不能保证能正常工作.
  • --autolibs=read-fail-为避免出现 sudo 错误,它将为下一部分生成要安装的依赖项列表.
  • --autolibs=read-only - to avoid the sudo error, but this is unlikely to result in a working binary.
  • --autolibs=rvm_pkg - will use the old rvm pkg install ... to install missing dependencies if they can be provided by RVM, this will take long time and is not guaranteed to work.
  • --autolibs=read-fail - to avoid the sudo error, it will produce list of dependencies to install for the next section.

通常,最简单的解决方案是要求root用户安装RVM期望的软件包.这实际上应该是您执行其他任何操作之前的第一站.使用静态二进制文件或手动构建所有依赖项可能有正当的理由,但是为什么不做这种简单的方法呢?

In general, the easiest solution is to ask root to install the packages that RVM expects. This should really be your first stop before doing anything else. There may be legitimate reasons to use static binaries or hand-build all your dependencies, but why not do things the easy way if you can?

如果无法安装必要的软件包,则可以尝试使用rvm list remote命令来查看RVM可以为您的系统安装任何预构建的二进制文件.如果缺少软件包,则可能需要查找可与rvm mount命令一起使用的静态二进制文件.您甚至可以在另一个系统上构建解释器,然后使用适当的远程URL来安装它.有关详情,请参见rvm help mount.

If you can't get the necessary packages installed, you can try the rvm list remote command to see if there are any pre-built binaries for your system that can be installed by RVM. If you're missing packages, then you might want to look for a static binary that you can use with the rvm mount command. You might even build the interpreter on another system, and mount it using the appropriate remote URL; see rvm help mount for details.

这篇关于如何在没有root用户访问权限的情况下安装rvm?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆