gpt4 book ai didi

ruby - rbenv 在可用 ruby​​ 版本列表中不包括系统 ruby​​ (1.8.7)

转载 作者:行者123 更新时间:2023-12-04 18:42:07 24 4
gpt4 key购买 nike

我在 Ubuntu 12.04 x64 桌面上使用 Ruby,但是 rbenv 出现问题 - 它只能看到 rbenv 安装的 ruby​​ 版本,看不到通过 Aptitude 安装的 Ubuntu 系统 ruby​​:

$> rbenv versions
1.9.2-p290
* 1.9.3-p0 (set by /home/kurtosis/bin/ruby/rbenv/version)
jruby-1.6.5.1
1.8.7.352-2ubuntu1也应该出现在该列表中。将本地或全局 ruby​​ 设置为系统,然后尝试运行 rubyirb导致挂起提示:
$> rbenv versions
1.9.2-p290
* 1.9.3-p0 (set by /home/kurtosis/bin/ruby/rbenv/version)
jruby-1.6.5.1
$> ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$> rbenv global system
$> rbenv versions
1.9.2-p290
1.9.3-p0
jruby-1.6.5.1
$> ruby --version
^C
$> rbenv system
rbenv: no such command `system'
$>

我在安装过程中是否遗漏了什么,您是否手动将系统 ruby​​ 添加到 rbenv 或其他东西?

通过 Aptitude 安装的 Ruby 1.8.7:
$> aptitude show ruby
Package: ruby
State: installed
Automatically installed: no
Version: 4.8
Priority: optional
Section: interpreters
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: all
Uncompressed Size: 36.9 k
Depends: ruby1.8 (> 1.8.7.334-1)
Suggests: ri, ruby-dev
Conflicts: irb, irb, rdoc, rdoc
Replaces: irb, irb, rdoc, rdoc
Provides: irb, rdoc
Provided by: ruby1.8
Description: Transitional package for ruby1.8
This is a transitional package which ensures that users of ruby will use ruby1.8 in the future. It can safely be removed.
Homepage: http://www.ruby-lang.org/


$> aptitude show ruby1.8
Package: ruby1.8
New: yes
State: installed
Automatically installed: yes
Version: 1.8.7.352-2ubuntu1
Priority: optional
Section: interpreters
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Uncompressed Size: 370 k
Depends: libc6 (>= 2.2.5), libruby1.8 (= 1.8.7.352-2ubuntu1)
Suggests: ruby1.8-examples, ri1.8
Conflicts: irb1.8 (< 1.8.7.249-3~), irb1.8 (< 1.8.7.249-3~), rdoc1.8 (< 1.8.7.249-3~), rdoc1.8 (< 1.8.7.249-3~), ri (<= 4.5), ri (<= 4.5), ri1.8 (<
1.8.7.334-4~), ri1.8 (< 1.8.7.334-4~), ruby (<= 4.5), ruby (<= 4.5), ruby1.8
Replaces: irb1.8, irb1.8, rdoc1.8, rdoc1.8
Provides: irb1.8, rdoc1.8, ruby, ruby-interpreter
Description: Interpreter of object-oriented scripting language Ruby 1.8
Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do
system management tasks (as in perl). It is simple, straight-forward, and extensible.

This package provides version 1.8 series of Ruby.

On Debian, Ruby 1.8 is provided as separate packages. You can get full Ruby 1.8 distribution by installing following packages.

ruby1.8 ruby1.8-dev ri1.8 ruby1.8-examples libtcltk-ruby1.8
Homepage: http://www.ruby-lang.org/

kurtosis@kurtosis-dm1-4050us:~/bin/projects/blogs/posterous/export$

小路:
$ echo $PATH
/home/kurtosis/bin/ruby/rbenv/shims:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/kurtosis/bin:/opt/apache/ant/default/bin:/opt/apache/maven/default/bin:/home/kurtosis/bin/ide/eclipse:/home/kurtosis/bin/ide/idea/default/bin:/opt/scala/bin/default/bin:/opt/typesafe-stack/bin:/home/kurtosis/bin/google/android/sdk/tools:/home/kurtosis/bin/google/android/sdk/platform-tools:/home/kurtosis/bin/google/android/ndk/default/:/opt/haskell/ghc/default/bin:/opt/haskell/platform/default/bin:/home/kurtosis/bin/ruby/rbenv/bin:/home/kurtosis/bin/node/node_modules/less/bin:/home/kurtosis/bin/google/go/bin:/home/kurtosis/bin/utilities/torrent/vuze:/home/kurtosis/bin/utilities/torrent/anomos:/home/kurtosis/bin/scripts:.

对于它的值(value),我在虚拟机中使用全新安装的 Ubuntu 12.04 Server x64 进行测试。通过 aptitude install 安装 ruby ruby-full`,然后下载并安装 rbenv。同样的问题,由于某种原因它仍然看不到系统 ruby 。新的路径是:
/home/kurtosis/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/kurtosis/.rbenv/bin:.

最佳答案

当你做的时候你会得到什么

rbenv global system
ruby -v

或者
rbenv local system
ruby -v

特殊版本名称系统告诉 rbenv 使用系统 Ruby(通过搜索 $PATH 检测到)。

请参阅第 3.1 节
https://github.com/sstephenson/rbenv

关于ruby - rbenv 在可用 ruby​​ 版本列表中不包括系统 ruby​​ (1.8.7),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10907497/

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