如何在 Ubuntu 中为单个用户安装 RVM,无需托管权限?

如何在 Ubuntu 中为单个用户安装 RVM,无需托管权限?

我正在尝试设置 RVM 在 Ubuntu 上以单用户模式执行,但如果不开放权限,则无法进行 make、configure 等操作。有什么建议吗?

通过 bash 安装 RVM < <(curl -shttps://rvm.beginrescueend.com/install/rvm),所有提到的 apt 存储库附加功能均已安装

[testuser@vm2:~] $ rvm install 1.9.2Installing Ruby from source to: /home/testuser/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching 
ruby-1.9.2-p290 - #extracted to /home/testuser/.rvm/src/ruby-1.9.2-p290 (already extracted)
Fetching yaml-0.1.4.tar.gz to /home/testuser/.rvm/archives
md5sum: : No such file or directory
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  460k  100  460k    0     0   479k      0 --:--:-- --:--:-- --:--:--  706k
Extracting yaml-0.1.4.tar.gz to /home/testuser/.rvm/src
Configuring yaml in /home/testuser/.rvm/src/yaml-0.1.4.
ERROR: Error running ' ./configure --prefix="/home/testuser/.rvm/usr"  ', please read /home/testuser/.rvm/log/ruby-1.9.2-p290/yaml/configure.log
Compiling yaml in /home/testuser/.rvm/src/yaml-0.1.4.
ERROR: Error running '/usr/bin/make ', please read /home/testuser/.rvm/log/ruby-1.9.2-p290/yaml/make.log
Installing yaml to /home/testuser/.rvm/usr
ERROR: Error running '/usr/bin/make install', please read /home/testuser/.rvm/log/ruby-1.9.2-p290/yaml/make.install.log
ruby-1.9.2-p290 - #configuring 
ERROR: Error running ' ./configure --prefix=/home/testuser/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/home/testuser/.rvm/usr ', please read /home/testuser/.rvm/log/ruby-1.9.2-p290/configure.log
ERROR: There has been an error while running configure. Halting the installation.

因此我检查了配置:

[2011-09-02 12:52:26]  ./configure --prefix="/home/testuser/.rvm/usr"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/testuser/.rvm/src/yaml-0.1.4':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

无权抄送:

[testuser@vm2:~] $ cc
-bash: /usr/bin/cc: Permission denied
[testuser@vm2:~] $ gcc
-bash: /usr/bin/gcc: Permission denied

我可以用 sudo 来运行它吗?不行:

[testuser@vm2:~] $ sudo cc
cc: no input files
[testuser@vm2:~] $ sudo rvm install 1.9.2
sudo: rvm: command not found

答案1

不清楚您要做什么。谁关闭了这些权限?您使用的是受限帐户吗?如果是这样,最好在其他地方安装类似的设置,在那里编译所需的一切,然后复制rsync到此帐户。

答案2

像我一样,您可能错过了列出仍然需要的 apt-get 安装的 rvm 要求<\b>部分。

# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following: sudo apt-get install /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

相关内容