rails控制台,RVM和readline的问题

时间:2010-12-21 11:48:41

标签: ruby rvm readline

我已经安装了rvm,以确保我的本地开发版本的ruby与我服务器上的特定应用程序(ruby 1.8.7)相同。我已经完成了这个,并安装了ruby 1.8.7确定。但是,当我尝试启动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 btw以防万一。

编辑 - 这是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:       ""

7 个答案:

答案 0 :(得分:67)

我在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

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

答案 1 :(得分:10)

运行命令

rvm requirements

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

rvm remove 1.9.2
rvm install 1.9.2

有效!

答案 2 :(得分:4)

我遇到了同样的问题并解决了它。 我查看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文件。

答案 3 :(得分:0)

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

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

答案 4 :(得分:0)

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

希望它有效!

答案 5 :(得分:0)

试过     gem install rb-readline

仍然无法正常工作。所以开始irb并做了一个需要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/

答案 6 :(得分:0)

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

rvm get stable
rvm reinstall 2.1.3