bin / rails服务器无法正常工作

时间:2015-05-06 17:55:18

标签: ruby-on-rails ruby server

Ruby版本 - ruby​​ 2.1.5p273(2014-11-13修订版48405)[x86_64-linux]

Error: 
Sorry, you can't use byebug without Readline. To solve this, you need to
rebuild Ruby with Readline support. If using Ubuntu, try `sudo apt-get
install libreadline-dev` and then reinstall your Ruby.
bin/rails:6: warning: already initialized constant APP_PATH
/home/kg/Mysite/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]

5 个答案:

答案 0 :(得分:2)

除了安装libreadline-dev之外,尝试将--with-readline-dir选项添加到Ruby的编译中。

CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline" rbenv install 2.3.1

请事先仔细检查readline目录是否存在。

答案 1 :(得分:1)

如果你赶时间,

打开你的byebug的history.rb

/Users/user/.rvm/gems/ruby-2.1.5@rails/gems/byebug-9.0.5/lib/byebug/history.rb

并注释掉以下行,

require 'readline'

但是,建议使用byebug进行初学者调试。但是,还有像

这样的替代品
pry, pry-byebug

答案 2 :(得分:0)

就像你的错误所说的那样,你需要安装readline(Ubuntu中的libreadline-dev),然后重新安装Ruby ...请执行此操作。

答案 3 :(得分:0)

如果您使用的是Fedora,请安装readline-devel,然后重新安装ruby(对我而言,它是ruby-installer

sudo dnf install readline-devel
ruby-install ruby

答案 4 :(得分:0)

ln -s /usr/local/opt/readline/lib/libreadline.dylib 
/usr/local/opt/readline/lib/libreadline.6.dylib

对我有用,多么神奇!