导轨c不在导轨5中工作

在rails 5应用程序内的终端中使用命令

rails c 

抛出的错误如下所示。 我不知道这在类似的问题中意味着什么,解决方案是使用弹簧停止。 我也试过了,但没有它仍然给出同样的错误。 如果有人能指出这里的错误,那就太好了。

 Running via Spring preloader in process 6457 /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require': dlopen(/Users/AmanChawla/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError) Referenced from: /Users/AmanChawla/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle Reason: image not found - /Users/AmanChawla/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' from /Users/AmanChawla/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/completion.rb:10:in `' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console.rb:3:in `' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:138:in `require_command!' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:68:in `console' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' from /Users/AmanChawla/Desktop/NewApp/bin/rails:9:in `' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' from /Users/AmanChawla/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load' from /Users/AmanChawla/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Users/AmanChawla/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from -e:1:in `' 

当我更新HomeBrew时,我最近遇到了这个问题,我也在使用rails 5并找到了这个解决方案,它对我有用:

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

资料来源: https : //gist.github.com/mcshakes/c87e8adda174c73be354094800b9756d

我通过简单地添加这个gem gem 'rb-readline'并运行bundle来解决这个问题。

RB-的ReadLine

这是对这个问题的标准修复尝试这个..它应该让你去

 brew rm -f readline brew install readline brew link readline --force 

这里是一个引用链接rails控制台由于libreadline没有加载

另一个问题可能是您的路径中有哪个版本的ruby – 请仔细检查。

 ruby -v ls -la `which ruby` 

然后检查你的路径