简体   繁体   English

无法在启用Byebug的情况下启动WEBrick

[英]Can't start WEBrick with Byebug on

When I try to run rails server , I get the following: 当我尝试运行rails server ,得到以下信息:

bin/rails:6: warning: already initialized constant APP_PATH

The only way I managed to start WEBrick is by commenting out gem 'byebug' in the Gemfile. 我设法启动WEBrick的唯一方法是在Gemfile中注释掉gem 'byebug'

At first I though it was Byebug's fault, but trying to run rails console gives me: 起初我虽然是Byebug的错,但是尝试运行rails console却给了我:

/home/fabio/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- readline (LoadError)
from /home/fabio/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /home/fabio/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
[...]

It seems I messed up at some point of the installation, but where? 似乎我在安装的某个时候搞砸了,但是在哪里?

I traced my steps back and found some info on the ruby-build page that could be related. 我追溯了自己的步骤,并在ruby-build页面上找到了一些可能相关的信息。

I ran $sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev as suggested and reinstalled ruby (using rbenv). 我按照建议运行了$sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev并重新安装了ruby(使用rbenv)。

Rails runs just fine now, no need to comment out Byebug. Rails现在运行良好,无需注释Byebug。 I can also run rails console now. 我现在也可以运行rails console

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

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