当我尝试运行rails server
时,我得到以下内容:
bin/rails:6: warning: already initialized constant APP_PATH
我设法启动WEBrick的唯一方法是在Gemfile中注释掉gem 'byebug'
。
起初我虽然是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'
[...]
似乎我在安装的某个时刻搞砸了,但在哪里?
答案 0 :(得分:0)
我追溯了我的步骤,在ruby-build页面上找到了可能相关的一些信息。
我按照建议运行了$sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev
并重新安装了ruby(使用rbenv)。
Rails现在运行得很好,无需评论Byebug。我现在也可以运行rails console
。