Każda próba uruchomienia rails console
w katalogu głównym mojej aplikacji Rails produkuje następujący błąd:Szyny błąd konsola: metoda niezdefiniowany `każdy” na zero: NilClass (NoMethodError)
undefined method `each' for nil:NilClass (NoMethodError)
Pełne śledzenia stosu:
/Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/railtie.rb:245:in `each_registered_block': undefined method `each' for nil:NilClass (NoMethodError)
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/railtie.rb:224:in `run_console_blocks'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/application.rb:461:in `block in run_console_blocks'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/engine/railties.rb:13:in `each'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/engine/railties.rb:13:in `each'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/application.rb:461:in `run_console_blocks'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/engine.rb:442:in `load_console'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/console.rb:34:in `initialize'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/console_helper.rb:9:in `new'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/console_helper.rb:9:in `start'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/commands_tasks.rb:78:in `console'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/command.rb:20:in `run'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands.rb:19:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
mam przypisać błąd do tego bloku w pliku railtie.rb
w lib szyn:
def each_registered_block(type, &block)
klass = self.class
while klass.respond_to?(type)
# The ':console' type doesn't seem to exist
klass.public_send(type).each(&block)
klass = klass.superclass
end
end
które z kolei pochodzi z tego bloku:
def run_console_blocks(app) #:nodoc:
each_registered_block(:console) { |block| block.call(app) }
end
I odinstalowaniu spring
gem i zainstalowaniu rubocop
gem. W przeciwnym razie mój Gemfile
zawiera domyślne klejnoty.
My Ruby jest 2.2.3
który jest powyżej 2.2.2
wersji zalecanej dla Rails 5.
Ruby version:2.2.3p173
Szyny version: wersja5.0.0.beta1.1
RVM:1.26.11
można zakładać pełną ślad stosu proszę? –