繁体   English   中英

rails控制台,RVM和readline的问题

[英]Problems with the rails console, RVM and 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,然后安装ruby 1.8.7再次获得readline支持。 (实际上该页面使用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:       ""

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

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

运行命令

rvm requirements

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

rvm remove 1.9.2
rvm install 1.9.2

有用!

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

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

 $ rm -rf $rvm_path/usr

然后

$ rvm requirements
$ rvm reinstall 1.9.3

希望它有效!

试过gem安装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/

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

rvm get stable
rvm reinstall 2.1.3

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM