gpt4 book ai didi

ruby-on-rails - rails 控制台 (`require' : cannot load such file)

转载 作者:数据小太阳 更新时间:2023-10-29 08:17:15 29 4
gpt4 key购买 nike

我在使用 Rails 控制台时遇到问题,它向我发送了这个错误

/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- readline (LoadError)
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/lib/ruby/2.1.0/irb/completion.rb:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/console.rb:3:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:128:in `require_command!'
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:59:in `console'
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands.rb:17:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
from /home/xploshioon/rails/mini_twitter/bin/rails:8:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:in `load'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:in `block in load'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:in `load'
from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

我在其他应用程序中遇到了类似的问题,但解决了再次创建应用程序的问题。但现在我有一些代码,所以我不想再次创建它。

有人知道这里有什么问题吗?

我有 linux mint 17 ruby 2.1.4p265(2014-10-27 修订版 48166)[i686-linux] rails 4.1.8

最佳答案

开始将其添加到您的 Gemfile 中:

gem 'rb-readline'

其次是:

bundle install

如果这不能解决问题,请按照以下步骤操作:

安装阅读线:

sudo apt-get install libreadline-dev

删除并重新安装 ruby​​

rvm remove 2.1.4    
rvm install 2.1.4

最后

bundle install

关于ruby-on-rails - rails 控制台 (`require' : cannot load such file),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27310020/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com