如何使用readline支持重新安装ruby?

San*_*mar 5 ruby rvm ubuntu-11.10

我已经按照https://github.com/wayneeseguin/rvm#installation上的说明通过RVM安装了Ruby 。

有关信息,我拥有所有档案(readline-5.2.tar.gz,readline-6.2.tar.gz,ruby-1.9.3-p327.tar.bz2,rubygems-1.8.24.tgz,wayneeseguin-rvm-stable。 tgz和yaml-0.1.4.tar.gz),但~/.rvm/archives我不想以任何方式重新下载它们。

当我做:

sudo /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
Run Code Online (Sandbox Code Playgroud)

我得到:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
Note, selecting 'libncurses5-dev' instead of 'ncurses-dev'
libtool is already the newest version.
sqlite3 is already the newest version.
libxslt1-dev is already the newest version.
libc6-dev is already the newest version.
openssl is already the newest version.
git-core is already the newest version.
subversion is already the newest version.
zlib1g is already the newest version.
libncurses5-dev is already the newest version.
curl is already the newest version.
libreadline6 is already the newest version.
libyaml-dev is already the newest version.
autoconf is already the newest version.
pkg-config is already the newest version.
libxml2-dev is already the newest version.
build-essential is already the newest version.
libssl-dev is already the newest version.
libreadline6-dev is already the newest version.
automake is already the newest version.
zlib1g-dev is already the newest version.
bison is already the newest version.
libsqlite3-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

我什至做到了:

$ rvm pkg install readline
$ rvm reinstall 1.9.2 --with-readline-dir=$rvm_path/usr
Run Code Online (Sandbox Code Playgroud)

但我仍然得到这个irb

Readline was unable to be required, if you need completion or history install readline then reinstall the ruby. You may follow 'rvm notes' for dependencies and/or read the docs page https://rvm.io/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries.
Run Code Online (Sandbox Code Playgroud)

我已经完成了4-5次重新安装过程。

ch4*_*d4n 5

关于什么

rvm reinstall 1.9.3
Run Code Online (Sandbox Code Playgroud)

一旦安装了基本的依赖项(例如构建要点等),就可以执行此操作。我遇到了类似的问题,必须安装一些依赖项,然后重新安装ruby可以解决问题。

下面的依赖项列表

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev \
autoconf libc6-dev libncurses5-dev automake libtool bison subversion pkg-config
Run Code Online (Sandbox Code Playgroud)

  • 第一次运行“rvm requests”后,这对我有用 (2认同)

mpa*_*pis 2

如果您安装了软件包,那么您的 ruby​​ 很可能已安装了 readline 支持rvm requirements

您可以通过运行以下命令来验证 readline 是否已安装:

rvm use 1.9.3
find $MY_RUBY_HOME -name readline.so | xargs ldd
Run Code Online (Sandbox Code Playgroud)

从我在回复中看到的情况来看,必须重复正确的流程:

rm -rf $rvm_path/usr/
rvm get head
rvm remove 1.9.3
rvm install 1.9.3 --debug
Run Code Online (Sandbox Code Playgroud)

如果您仍然无法使其工作 - 请确保重复上述步骤,不要添加额外的标志或开关,确保清理/etc/rvmrc~/.rvmrc清除额外的编译标志。如果全部失败,请提供rvm install 1.9.3 --debug命令的输出。