为什么在尝试启动Rails控制台时出现Readline错误? [英] Why do I get a Readline error when trying to start rails console?

查看:127
本文介绍了为什么在尝试启动Rails控制台时出现Readline错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:尝试其他地方的解决方案时,我可能搞砸了我的系统.我从头开始,并顺利安装了Ruby 1.9.3.现在尝试让ree-1.8.7与...一起好玩...

UPDATE: I probably messed up my system while trying solutions found somewhere else. I started from scratch and Ruby 1.9.3 installed without a hitch. Now to try to get ree-1.8.7 to play nice alongside...

我正在尝试在Kubuntu(我相信11.10)上使用RVM安装Ruby 1.9.3.到目前为止,我在Readline上遇到了很多问题,但是找到了除此以外的所有问题的答案.

I'm trying to install Ruby 1.9.3 using RVM on Kubuntu (11.10 I believe). I've been having plenty of issues with Readline so far, but found the answer to all but this one.

我以这种方式安装了Ruby 1.9.3:

I installed Ruby 1.9.3 this way:

rvm install 1.9.3
# Install of ruby-1.9.3-p0 - #complete 
cd ~/.rvm/src/ruby-1.9.3-p0/ext/readline/
~/.rvm/src/ruby-1.9.3-p0/ext/readline $ ../../ruby extconf.rb --with-editline-dir="/usr" --with-readline-dir="/usr"
# any other way of doing this resulted in simply readline not being loaded when trying to start the console
# I have libreadline6 and libreadline6-dev installed (and all the packages requested in `rvm requirements`
make install
# compiling readline.c                                                                                                                                                                                      
# linking shared-object readline.so                                                                                                                                                                         
# /usr/bin/install -c -m 0755 readline.so /home/mbillard/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/x86_64-linux                                                                                    
# installing default readline libraries 

到目前为止,一切似乎都可以正常运行,但是当我尝试启动控制台时,出现此错误:

So far everything looks to have run properly but when I try to start the console I get this error:

/home/mbillard/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `require': /home/mbillard/.rvm/usr/lib/libreadline.so.6: undefined symbol: UP - /home/mbillard/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/x86_64-linux/readline.so (LoadError)
  from /home/mbillard/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
  from /home/mbillard/.rvm/gems/ruby-1.9.3-p0@taskman/gems/railties-3.2.1/lib/rails/commands/console.rb:3:in `require'
  from /home/mbillard/.rvm/gems/ruby-1.9.3-p0@taskman/gems/railties-3.2.1/lib/rails/commands/console.rb:3:in `<top (required)>'
  from /home/mbillard/.rvm/gems/ruby-1.9.3-p0@taskman/gems/railties-3.2.1/lib/rails/commands.rb:38:in `require'
  from /home/mbillard/.rvm/gems/ruby-1.9.3-p0@taskman/gems/railties-3.2.1/lib/rails/commands.rb:38:in `<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'

我在上面的命令中编译Readline时尝试使用rvm install 1.9.3 --with-readline-dir="$rvm_path/usr"$rvm_path,但是这些导致此错误:

I tried using rvm install 1.9.3 --with-readline-dir="$rvm_path/usr" and using $rvm_path when compiling Readline in the command above but those resulted in this error:

checking for tgetnum() in -lncurses... yes
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking for readline() in -lreadline... no
checking for readline() in -ledit... no
checking for editline/readline.h... no

因此,感谢您提供的任何帮助.

So, thanks for any help you can provide.

推荐答案

请阅读以下内容的输出:

Please read the output of:

rvm requirements

它将显示您需要安装以充分利用Ruby的库的列表

It will show you list of libraries you need to install to make good use of Ruby

在安装所有库之后,清理已安装rvm的库并重新安装Ruby:

After installing all the libs, clean rvm installed libs and reinstall Ruby:

rm -rf $rvm_path/usr
rvm reinstall 1.9.3

这篇关于为什么在尝试启动Rails控制台时出现Readline错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆