在用户目录上安装较新版本的 RubyGems :仍在使用系统范围的安装吗?
我在安装了 RubyGems 1.1.1 的共享 Debian 系统上有一个用户帐户,但我无法让他们升级它,至少目前是这样。
我正在尝试按照 RubyGems 用户指南章节 3.2 在用户目录中安装 RubyGems。
到目前为止,我已经在 $HOME/rubygems 安装了最新的 RubyGems (1.8.10),并且修复了以下环境变量:
- GEM_HOME 到 $HOME/rubygems/gems
- PATH,以便在系统范围 /usr/ 之前有 $HOME/rubygems/bin bin (包含旧的 gem)
路径应该工作正常,因为 which gem 结果为 $HOME/rubygems/bin/gem。
尽管如此,当我运行gem -v时,我得到了1.1.1。
这可能与 ruby require 最终成为 RubyGems 的系统范围文件有关,因为 $HOME/rubygems/bin/gem 开头为
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'
What should I do to get my local-installed-version 1.8.10 running?
br, 灯子
I have an user account on a shared Debian system that has RubyGems 1.1.1 installed and I can't make them upgrade it, at least at the moment.
I'm trying to install a new RubyGems installation locally on my home directory, following the instructions from RubyGems user guide chapter 3.2 Installing RubyGems in a User Directory.
So far, I got now latest RubyGems (1.8.10) installed at $HOME/rubygems and I have fixed the following environment variables:
- GEM_HOME to $HOME/rubygems/gems
- PATH to have $HOME/rubygems/bin before systemwide /usr/bin (which contains the old gem)
Path should be working OK, since which gem results as $HOME/rubygems/bin/gem.
Still, when I run gem -v I get 1.1.1.
This probably has something to do with ruby require ending up to the system-wide files of RubyGems, since the $HOME/rubygems/bin/gem starts with
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'
What should I do to get my local-installed-version 1.8.10 running?
br,
Touko
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道这是否正是您想要的。但最简单的方法可能是使用 rvm。
https://rvm.beginrescueend.com/rvm/install/
使用rvm,您可以拥有您的在您的主目录中拥有独立的 ruby 环境,其中包含您需要的工具。
I don't know if this is exactly what you want. But the easiest way would probably be to use rvm.
https://rvm.beginrescueend.com/rvm/install/
With rvm you could have your own self contained ruby environment in your home directory with exactly the tools that you need.