gpt4 book ai didi

ruby - 在 Ubuntu 中安装 Ruby 1.9.3 出现错误

转载 作者:行者123 更新时间:2023-12-04 19:21:59 25 4
gpt4 key购买 nike

当我尝试安装 Ruby 1.9.3 时,我不得不做很多杂耍,社区中提到 ruby1.9.1是为 Ruby 1.9.3 安装的包。现在,如果我运行 ruby ,我得到

<internal:gem_prelude>:1:in `require': 
cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:1:in `<compiled>'

我能做些什么?

仅供引用,我通过 sudo apt-get remove --purge ruby1.8 libruby1.8 卸载了我的 comp 中的所有内容

然后我通过 sudo apt-get install ruby1.9.1 libruby1.9.1 安装了 Ruby1.9.1

我该怎么办?

编辑 :

在评论之后,我使用 rvm 安装了更新的 ruby​​ 1.9.3,现在一切都很完美。

道德 :

不要将 apt-get 用于 ruby 。使用 rvm、gem 和其他 ruby​​ 工具。这个棒极了。

最佳答案

如果您使用 apt 安装了 Ruby 系统范围那么最新的 RubyGems 将不会包含在安装中。 Ruby 是语言,RubyGems 是必须单独安装的包管理器。

要安装 RubyGems,只需转到 here并按照说明进行操作:

  1. Download from above.
  2. Unpack into a directory and cd there
  3. Install with: ruby setup.rb (you may need admin/root privilege)
  4. For more details and other options, see: ruby setup.rb --help

关于ruby - 在 Ubuntu 中安装 Ruby 1.9.3 出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13785642/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com