【问题标题】:How to reinstall ruby with readline support?如何使用 readline 支持重新安装 ruby​​?
【发布时间】:2012-12-20 04:48:09
【问题描述】:

我已经按照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

我明白了:

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.

我什至做过:

$ rvm pkg install readline
$ rvm reinstall 1.9.2 --with-readline-dir=$rvm_path/usr

但我仍然在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.

我已经重新安装了 4-5 次。

【问题讨论】:

    标签: ruby rvm ubuntu-11.10


    【解决方案1】:

    怎么样

    rvm reinstall 1.9.3
    

    一旦你安装了基本的依赖项,比如构建要素等,你就可以这样做。我遇到了类似的问题,我不得不安装一些依赖项,然后重新安装 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
    

    【讨论】:

    • 这在我第一次运行rvm requirements后对我有用
    【解决方案2】:

    考虑到您有 RVM,您应该利用有用的命令 rvm requirements,因为这将为您提供您需要为您的特定环境/操作系统运行的命令。

    【讨论】:

      【解决方案3】:

      如果您安装了来自 rvm requirements 的软件包,您的 ruby​​ 很可能安装了 readline 支持。

      您可以通过运行验证是否安装了 readline:

      rvm use 1.9.3
      find $MY_RUBY_HOME -name readline.so | xargs ldd
      

      根据我在回复中看到的,必须重复正确的流程:

      rm -rf $rvm_path/usr/
      rvm get head
      rvm remove 1.9.3
      rvm install 1.9.3 --debug
      

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

      【讨论】:

      • ldd: missing file arguments
      • 您的$rvm_path/src/ruby-1.9.3-p327/ext/readline/mkmf.log 中有什么内容?
      • 我正在测试它是否有效,但我的终端在安装后挂起(我没有在新终端上收到提示)。这是rvm install 1.9.3 --debug的输出
      • 等等等等.. 取消采购~/.profile 后一切都好了。现在你能告诉我我的 readline 出了什么问题吗?你的回答对我有什么帮助?
      • 大声笑你的设置有问题,最好为 rvm 开一张票,所以不是 rvm 的主要支持站点:github.com/wayneeseguin/rvm/issues
      【解决方案4】:

      你可能只是用老式的 configure / make 方式重建 ruby​​ 可执行文件。不应该花那么长时间。优点是它会利用它找到的依赖项,例如 readline。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-07-18
        • 2012-05-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多