gpt4 book ai didi

ruby-on-rails - Rails 命令不起作用(spring gem 错误)

转载 作者:数据小太阳 更新时间:2023-10-29 09:03:00 24 4
gpt4 key购买 nike

老实说,我迷路了。每次我尝试运行任何 rails 命令 ie, rails g controller home 时,命令行都会向我抛出此错误,我不知道发生了什么。我已经卸载并重新安装了 spring 并且我还进行了 google 搜索。

有人帮忙吗?

Johnny@Johnnys-MacBook-Pro original_skillup (feature/s3_uploader) $ rails g controller spring
/Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:102:in `block in preload': undefined method `[]' for nil:NilClass (NoMethodError)
from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:102:in `map'
from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:102:in `rescue in preload'
from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:115:in `preload'
from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/Johnny/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Johnny/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'

谢谢!

最佳答案

我认为您安装了 Spring gem 并且 Controller 的名称有冲突。

https://github.com/rails/spring

尝试更改 Controller 的名称。希望它有效。干杯!

关于ruby-on-rails - Rails 命令不起作用(spring gem 错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30770100/

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