【发布时间】:2014-07-15 15:40:47
【问题描述】:
对于给定的 ubuntu 用户,我能够让单用户安装正常工作。对于单用户安装,在安装 rvm 后,您只需将源代码添加到主文件夹中的 .bash_profile 中,然后在 Ubuntu 桌面上,转到终端的 Edit > Profile Preferences > Title and Command > Run Command as a登录外壳。现在您可以开始切换红宝石并添加宝石:
rvm list
rvm install 1.9.3
rvm use 1.9.3
rvm gemset create MyGemSet
rvm use 1.9.3@MyGemset
rvm gemdir
gem install passenger
但是。我正在使用带有生产服务器设置的乘客,所以我更喜欢使用 rvm 系统范围的安装。所以我在系统范围内安装了 rvm 和 ruby:
sudo -i
curl -L https://get.rvm.io | bash -s stable --ruby
# echo '[[ -f "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"' >> ~/.bash_profile
# echo 'PATH=$PATH:/usr/local/rvm/bin' >> ~/.bashrc
# rvm list
rvm rubies
ruby-1.9.3-p547 [ i686 ]
=* ruby-2.1.2 [ i686 ]
# rvm use 1.9.3
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.
我需要以 root 身份运行“rvm use 1.9.3”的原因是因为我想为 1.9.3 创建一个 gemset,但我不能作为普通用户执行此操作,因为我使用的是系统范围的安装。错误提示“您需要更改终端模拟器首选项以允许登录 shell。”。但我在 Ubuntu 上,默认情况下未启用 root 用户,出于安全原因,我也不想解锁 root 用户帐户。那么我们如何处理想要在 Ubuntu Desktop 上进行系统范围安装的情况(在这种情况下我使用的是 12.04)?
【问题讨论】:
-
在登录 shell 中运行它有帮助吗? "/bash/bin --login"
-
@MIdhunKrishna santosh 将 bash 脚本添加到 .bashrc 而不是 .bash_profile 的解决方案实际上使它起作用。在我进行此更改之前,即使从远程 ssh 也无法正常工作。