【问题标题】:Problems with the rails console, RVM and readlinerails 控制台、RVM 和 readline 的问题
【发布时间】:2011-05-28 18:54:55
【问题描述】:

我已经安装了 rvm,以确保我的本地开发版本的 ruby​​ 与我正在处理的特定应用程序(ruby 1.8.7)的服务器版本相同。我已经这样做了,并安装了 ruby​​ 1.8.7 ok。但是,当我尝试启动 rails 控制台时,出现此错误:

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 http://rvm.beginrescueend.com/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries.
Couldn't load Wirble: no such file to load -- wirble

我已阅读错误所指页面上的注释 (http://rvm.beginrescueend.com/packages/readline/),并按照说明进行操作,其中基本上涉及安装 readline,卸载 ruby​​ 1.8.7,然后使用 readline 支持再次安装 ruby​​ 1.8.7。 (实际上该页面使用 ruby​​ 1.9.2 作为示例,但我假设它也应该与 1.8.7 一起使用。也许情况并非如此)。

但是,我仍然得到同样的错误。有没有其他人经历过这个并想通了?
感谢任何建议 - 最大

编辑 - 我正在使用 Ubuntu 9.10 顺便说一句,以防万一。

编辑 - 这是我对rvm info 的输出,如下所示:

$ rvm info

system:

  system:
    uname:       "Linux max-laptop 2.6.31-22-generic #68-Ubuntu SMP Tue Oct 26 16:38:35 UTC 2010 i686 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.0.33(1)-release (i486-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.1.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]"

  homes:
    gem:          "not set"
    ruby:         "not set"

  binaries:
    ruby:         "/usr/bin/ruby"
    irb:          "/usr/bin/irb"
    gem:          "/usr/bin/gem"
    rake:         "/usr/bin/rake"

  environment:
    PATH:         "/home/max/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/lib/gems/1.8/bin:/home/max/software/svnmerge:/home/max/.gem/ruby/1.8/bin:/home/max/work/e_learning_resource/trunk/public/assets/dvd_files/bin:/opt/firefox:/home/max/.rvm/bin:/home/max/.rvm/bin"
    GEM_HOME:     ""
    GEM_PATH:     ""
    MY_RUBY_HOME: ""
    IRBRC:        ""
    RUBYOPT:      ""
    gemset:       ""

【问题讨论】:

  • 将rvm info 的输出附加到您上面的问题中怎么样?
  • 完成,谢谢(见上文)

标签: ruby rvm readline


【解决方案1】:

我在 Ubuntu 10.04 上遇到了与 1.9.2 类似的问题,但症状相同。为了让它工作:

rvm pkg install readline

或在 RVM 1.6.32 版本之前,您需要以下命令

rvm package install readline

然后:

apt-get install ncurses-dev

然后在http://rvm.beginrescueend.com/packages/readline/接受他们的指示

cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline
ruby extconf.rb -- --with-readline-dir="$HOME/.rvm/usr"
make install

我实际上已经在服务器上完成了系统 rvm 安装,所以我需要这样做:

cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline
ruby extconf.rb -- --with-readline-dir="/usr/local/rvm/usr"
make install

之后我就可以完全访问控制台了。

【讨论】:

  • 感谢 Geoff Lanotte 他的解决方案也适用于 Ruby 1.9.2-p3 +RVM +Rails 3.0.6
  • 感谢您的修复。这个对我有用。其他人可能唯一想要检查的是路径(假设您正在剪切和粘贴)。我的道路与 Geoff 略有不同。除此之外,它奏效了。谢谢。
  • 对我来说,我必须使用 pkg,而不是 package。使用 rvm pkg install readline
  • 谢谢,我更新了它以处理新的命令名称以及旧的命令名称。
  • 不确定我错过了什么。运行 ubuntu 11.10,使用 ruby​​ 1.9.3。并且 make install 不做任何事情。 ~/.rvm/src/ruby-1.9.3-p0/ext/readline$ ruby extconf.rb -- --with-readline-dir="$HOME/.rvm/usr"checking for tgetnum() in -lncurses... yeschecking for readline/readline.h... yeschecking for readline/history.h... yeschecking for readline() in -lreadline... nochecking for readline() in -ledit... nochecking for editline/readline.h... no~/.rvm/src/ruby-1.9.3-p0/ext/readline$ make installmake: Nothing to be done for 'install'.
【解决方案2】:

运行命令

rvm requirements

它显示了需求和依赖关系。安装这些并在 rvm 上重新安装 ruby​​

rvm remove 1.9.2
rvm install 1.9.2

有效!

【讨论】:

  • 谢谢,运行 rvm requirements 并检查所需的 Linux 软件包在 Ubuntu 12.04 中也有帮助。
  • 是的,这很好用;就我而言,我发出了 (1) $ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl ... (2) $ rvm reinstall all --force
【解决方案3】:

我遇到了同样的问题并解决了。 我检查http://rvm.beginrescueend.com/packages/readline/ 请检查以下两件事:

  1. sudo aptitude install libreadline5-dev libncurses5-dev 使用 libreadline6-dev,如果您有新版本。
  2. ruby extconf.rb -- --with-readline-dir='/home/youruser/.rvm/usr/include/readline' 确保您在指向的 with-readline-dir 下有 readline lib 文件。

【讨论】:

    【解决方案4】:

    您是否尝试过本教程以使用 brew 的 readline 安装?

    http://blog.plataformatec.com.br/2010/05/accented-chars-in-irb-with-rvm-and-ruby-1-8-7/

    【讨论】:

    • 我没听说过 Brew,但它看起来像是 OSX 的包管理器。我正在使用 ubuntu 9.10 - 抱歉,我没有在我的 OP 中提到这一点。
    【解决方案5】:
    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.
    

    如果您关注link,您将找到一些有关如何解决此问题的说明。对我有用的是第一步,删除所有手动安装的包:

     $ rm -rf $rvm_path/usr
    

    然后

    $ rvm requirements
    $ rvm reinstall 1.9.3
    

    希望它有效!

    【讨论】:

      【解决方案6】:

      试过了 gem install rb-readline

      还是不行。所以开始 irb 并做了一个 require readline。错误消息有所帮助。

          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.
      1.9.3p327 :001 > require 'readline'
      LoadError: /usr/local/lib/libreadline.so.6: undefined symbol: UP - /home/sudhir/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/x86_64-linux/readline.so
          from /home/sudhir/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
          from /home/sudhir/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
          from (irb):1
          from /home/sudhir/.rvm/rubies/ruby-1.9.3-p327/bin/irb:16:in `<main>'
      1.9.3p327 :002 > ^[[6^[[A^[[A^[[B^C^C
      

      所以我的问题是 /usr/local/lib 中的所有 libreadline*。我已经从源代码安装了 readline,这搞砸了。

      按照此处的说明进行修复。 http://vkarthickeyan.wordpress.com/2012/02/16/mysql-symbol-lookup-error-usrlocalliblibreadline-so-6-undefined-symbol-up/

      【讨论】:

        【解决方案7】:

        我在使用 Ruby 2.1.3 时遇到了这个问题。升级 RVM 然后重新安装 Ruby 对我有用:

        rvm get stable
        rvm reinstall 2.1.3
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2011-11-08
          • 2015-02-20
          • 2021-02-13
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-02-24
          相关资源
          最近更新 更多